Android MAUI XamlC error : Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

huangapple go评论110阅读模式
英文:

Android MAUI XamlC error : Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

问题

只有在尝试使用 .net7 进行 Android 的 .NET MAUI 发布构建时,我才会收到上述错误。在调试模式下似乎正常工作,我可以部署并在物理设备上测试它。

我尝试在线搜索,但似乎没有提到上述问题。

我可以在我的应用中看到三个 xaml 页面中的两个页面报错,而一个页面似乎正常。我的应用中使用了以下库,如果有差异的话:

  • CommunityToolkit MediaElement
  • Fody PropertyChanged
  • App Center Crashes, distribute, analytics
  • QRCoder
  • Refit

带有 MediaElement 的页面似乎没问题。

此外,我正在运行在苹果 ARM 上使用 Parallels 的 VS2022 17.6.4。有什么可能出错的想法吗?

英文:

I get the above error only when trying to do a .NET MAUI release build for Android using .net7. This seems to work fine in debug mode and I am able to deploy and test it on a physical device.

I have tried to search online but there doesnt seem to be any mention of the above.

I can see the error against two of the three xaml pages in my app, and one seems fine. I am using the following libraries in my app if that makes any difference

CommunityToolkit MediaElement
Fody PropertyChanged
App Center Crashes, distribute, analytics
QRCoder
Refit

The page with the MediaElement seems fine though

Also I am running VS2022 17.6.4 using Parallels on an Apple ARM. Any ideas what could be going wrong.

答案1

得分: 0

I was using the following declaration x:DataType=viewModels:MyViewModel in my ContentPage. This worked fine in Debug but the Release build was failing. Removing this seemed to resolve the problem.

英文:

Found the issue, I was using the following declaration x:DataType=viewModels:MyViewModel in my ContentPage. This worked fine in Debug but the Release build was failing. Removing this seemed to resolve the problem.

huangapple
  • 本文由 发表于 2023年6月25日 19:03:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/76550084.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定