由于某种原因,我无法在发布模式下构建项目,这是我得到的错误
> Severity Code Description Project File Line Suppression State
Error The "XamlCTask" task failed unexpectedly.
System.InvalidOperationException: Operation is not valid due to the current state of the object.
Server stack trace:
at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader)
at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters)
at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList`1& thrownExceptions)
at Xamarin.Forms.Build.Tasks.XamlTask.Execute()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Build.Framework.ITask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
尝试了一切,更新了Xamarin.forms软件包,删除了bin / obj文件夹,使用管理员权限重新启动vs,由于我因无法将应用程序投入生产而深深感激任何输入
答案 0 :(得分:2)
无法在Xamarin表单的发布模式下构建解决方案
是的,这是Xamarin.Forms
的已知问题,此问题的解决方法是将Xamarin.Forms
降级为2.3.4.224
。
您可以检查以下线程以获取更多详细信息:
Build failed when upgrade Xamarin.Forms to latest version
此外,如果您的Xamarin.Form
版本与已安装的NuGet软件包不兼容/不匹配,我们最好更新nuget软件包以使其与NuGet软件包的依赖项匹配。
希望这会有所帮助。
答案 1 :(得分:0)
请执行以下操作。
肯定会起作用。