重新编译应用程序时发生的奇怪错误

时间:2019-05-11 02:26:43

标签: c# xamarin

当我尝试构建应用程序时,至少在xamrian 3.6.0.2中出现一个非常奇怪的错误,我什至重新启动了该应用程序,甚至修复了该应用程序并重新安装了Visual Studio 2019,但仍然遇到相同的错误。

但是我的项目说了它的构建,但是当它链接到编译器时失败了,所以没人能解决这个问题

有问题的错误是

  

严重性代码描述项目文件行抑制状态   错误MSB4018“ XamlCTask”任务意外失败。   System.ArgumentException:具有相同键的项已经被   添加。

     

服务器堆栈跟踪:位于   System.ThrowHelper.ThrowArgumentException(Exception资源资源)   在System.Collections.Generic.Dictionary 2.Insert(TKey key, TValue value, Boolean add) at Xamarin.Forms.Xaml.XamlParser.ParseXamlElementFor(IElementNode node, XmlReader reader) at Xamarin.Forms.Xaml.XamlParser.ReadNode(XmlReader reader, Boolean nested) at Xamarin.Forms.Xaml.XamlParser.ParseXamlElementFor(IElementNode node, XmlReader reader) at Xamarin.Forms.Xaml.XamlParser.ParseXaml(RootNode rootNode, XmlReader reader) at Xamarin.Forms.Build.Tasks.XamlTask.ParseXaml(Stream stream, TypeReference typeReference) at Xamarin.Forms.Build.Tasks.XamlCTask.Execute(IList 1和thrownExceptions中)   在Xamarin.Forms.Build.Tasks.XamlTask​​.Execute()在   System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr   md,Object [] args,对象服务器,Object []&outArgs)   System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage   msg)

     

在[0]处抛出异常:   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage   reqMsg,IMessage retMsg)   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&   msgData,Int32类型),位于Microsoft.Build.Framework.ITask.Execute()
  在   Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()   在   Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()FuelStockApp C:\ Users \ David.nuget \ packages \ xamarin.forms \ 3.6.0.264807 \ build \ Xamarin.Forms.targets 107

<Target Name="XamlC" AfterTargets="AfterCompile" Inputs="$(IntermediateOutputPath)$(TargetFileName)" Outputs="$(IntermediateOutputPath)XamlC.stamp" Condition=" '$(DesignTimeBuild)' != 'True' ">
            <XamlCTask
                Assembly = "$(IntermediateOutputPath)$(TargetFileName)"
                ReferencePath = "@(ReferencePath)"
                OptimizeIL = "true"
                DebugSymbols = "$(DebugSymbols)"
                DebugType = "$(DebugType)"
                KeepXamlResources = "$(XFKeepXamlResources)" />
            <Touch Files="$(IntermediateOutputPath)XamlC.stamp" AlwaysCreate="True" />
            <ItemGroup>
                <FileWrites Include="$(IntermediateOutputPath)XamlC.stamp" />
            </ItemGroup>
</Target>

0 个答案:

没有答案