如何在 Android 项目上的 Visual Studio for Mac 中将“EmbedAssembliesIntoApk”MSBuild 属性设置为“true”?

Ben*_*son 7 c# xamarin

我的 Android 项目遇到问题,想要将 EmbedAssembliesIntoApk 设置为 true ?

错误是:

error XA0130: Please disable fast deployment in the Visual Studio project property pages or edit the project file in a text editor and set the 'EmbedAssembliesIntoApk' MSBuild property to 'true'.
Run Code Online (Sandbox Code Playgroud)

我可以从哪里将 EmbedAssembliesIntoApk 设置为 true ?

Che*_*SFT 6

从您的错误消息中,您可以查看一下快速部署,快速部署的工作原理是进一步缩小Android应用程序包的大小。

要消除此错误消息,有两种方法可以做到,一种是双击Android项目属性---选择Android选项---禁用使用快速开发(仅限调试模式)

默认情况下启用快速部署,并且可以通过将该$(EmbedAssembliesIntoApk)属性设置为 True 在调试版本中禁用。

另一种方法是转到csproj 文件,尝试放置<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>在调试配置中PropertyGroup

关于去csproj文件,可以看一下:

如何在 Visual Studio 解决方案资源管理器中查找打开的 Xamarin Android 或 iOS csproj 文件


小智 5

我从 Visual Studio for Mac 部署到设备时遇到了同样的问题。在部署过程中,它只显示“快速部署”消息,并且永远不会结束。在项目选项中,快速部署被禁用,但我添加了

<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>直接在csproj中解决了。现在它的部署速度确实很快。

在此输入图像描述


sul*_*ifi 3

在 Maui 项目中单击右键,然后选择最后一个属性

展开 Android,然后选择选项,转到快速部署,然后取消选中所有

在此输入图像描述