4

Heyho,

I'm working my way through Xamarin.Forms right now and today I got the following error when I tried to Release compile the UWP project of my app (Debug is working):

Payload contains two or more files with the same destination path 'System.Runtime.CompilerServices.dll'. Source files:
C:\Users\[...]\.nuget\packages\runtime.win10-x64-aot.microsoft.netcore.universalwindowsplatform\6.2.0-preview1-26926-04\runtimes\win10-x64-aot\lib\uap10.0.15138\System.Runtime.CompilerServices.Unsafe.dll
C:\Users\[...]\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.1\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll

The projects shared library compiles as netstandard2.0 and again includes a netstandard2.0 library itself, though I don't believe it should be a problem.

The UWP project references "Universal Windows" and the (self-compiled) SQLite.Net library. It also referenced the "Microsoft.NETCore.UniversalWindows" NuGet package, but I uninstalled it (attempting to solve the issue above). I also tried Cleaning and recompiling the solution, removing and restoring the actual NuGet directories, adding and removing references, up- and downgrading of the UWP packages, changing the build order of my solutions projects...but nothing worked.

Does anyone have any idea what I could do here? My main problem is that the error seems to come from .NET packages that I can't exchange/remove without crashing the whole project...

1

1 Answer 1

1

Thanks to this question I found a solution to my problem.

Though it wasn't the build target under (Project properties->Build->Build Target) for me I noticed the checkbox "Compile with .NET Native toolchain". I removed the tick and the project compiles fine for Release.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.