Error: GenerateWinPRTManifest

2019-07-03 08:17发布

问题:

I've tried to create a new monogame windows phone 8 project, when I tried to run it I got this error:

Error   1 The "GenerateWinPRTManifest" task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.CCIHarvestRegistrationInformation(ProcessWinmd processWinmd, Dictionary`2 inprocServers)
   at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.UpdateWinmdRegistration()
   at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.ExecuteImplementation()
   at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext() MonoGameWP8

回答1:

I got this error today.
I had referenced DLLs which had been compiled for a different architecture (ARM instead of x86).
So built them again, removed their reference and referenced them again.
Hope this helps



回答2:

Just one update - I've got same error today too at my WP8.0 project. I have two projects using Lumia.Imaging SDK added by NuGet - different time, so different lib version. But just remove reference in VS2013 on both project and ensure to to target same .dll wasn't enought for me. I had to edit *.csproj file in text editor of my older project and remove all reference on that library there too. And after it just add .dll by hand works fine for me.