When building my app for a store release with 6.2.2, I see the following error:
1>"O:\Build\Home\App.csproj" (_GenerateAppxPackage target) (1) ->
1>(_ComputeAppxPackagePayload target) ->
1> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1766,5): error APPX1101: Payload contains two or more files with the same destination path 'System.Runtime.CompilerServices.Unsafe.dll'. Source files:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1766,5): error APPX1101: C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86-aot.microsoft.netcore.universalwindowsplatform\6.2.2\runtimes\win10-x86-aot\lib\uap10.0.15138\System.Runtime.CompilerServices.Unsafe.dll
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(1766,5): error APPX1101: C:\Users\username\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.1\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
This error does not occur with 6.1.9.
I'm also facing the same issue while creating app packages for submission to the Store. This is also being caused by 6.2.2 not with 6.1.9.
Payload contains two or more files with the same destination path 'System.Runtime.CompilerServices.Unsafe.dll'. Source files:
C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86-aot.microsoft.netcore.universalwindowsplatform\6.2.2\runtimes\win10-x86-aot\lib\uap10.0.15138\System.Runtime.CompilerServices.Unsafe.dll
C:\Users\itsmy\.nuget\packages\system.runtime.compilerservices.unsafe\4.5.1\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
We are seeing this bug too.
I'm seeing the same issue, is there any workaround?
@bezysoftware @charlesroddie You are seeing this problem when submitting ARM64 build, or with x86|x64|arm packages as well?
I think it is unrelated to ARM64, also happens without using it.
You can reproduce it quite easily be creating a new project, adding Microsoft.EntityFrameworkCore.Sqlite 2.1.4 NuGet package and trying to build in Realease-Mode
I'm doing only x86|x64. Vs 15.9.2 btw
@bezysoftware Wondering, what's the MinVersion of your project? I've built our project with MinVersion 16299, TargetVersion 17134, UWP NuGet 6.2.2 targeting x86|x64|arm with no errors in certification wizard or when uploading.
It's not about the certification wizard, the error shows up right after we start building the app in Release mode. I think it makes a difference when adding Microsoft.EntityFrameworkCore.Sqlite 2.1.4 NuGet package to your solution
Just tested, when I added the Microsoft.EntityFrameworkCore.Sqlite NuGet it indeed failed to compile in Release, even when I tested the 2.2.0-preview NuGet version. It looks like EntityFrameworkCore compatible with Microsoft.NETCore.UniversalWindowsPlatform 6.2.2 needs to be released first.
Been playing with it and found the combination that's the problem in my case:
MinVersion&TargetVersion 16299, UWP 6.2.2, System.Reactive 4.1.2. If I downgrade System.Reactive to 4.0.0 it compiles
@martinsuchan Presumably .Net Native has a bug related to System.Runtime.CompilerServices.Unsafe that is showing up in various libraries using unsafe code. Unlikely that this issue can be fixed in consuming libraries.
I don't see any evidence that the .Net Native team monitors this repo. Reposting to CoreRT.
Updating to System.Runtime.CompilerServices.Unsafe 4.5.2 should fix this for you. I've started an internal email thread to see if we can either fix it, or do something with the error message.
It seems Store will not accept UWP packages with v6.2.2 and this version has been unlisted from nuget. Would have been nice to mention this somewhere so I wouldn't spend half a day searching for the reason my submission failed
I spent half day trying to make 6.2.2 pass in Store as well, with no success. I'm a bit worried that no-one in Microsoft tried to publish app with this broken SDK to Store.
And you're right, the version 6.2.2 was just unpublished:
https://www.nuget.org/packages/Microsoft.NETCore.UniversalWindowsPlatform/
Just a heads-up, it appears that they have fixed their Store ingestion issue regarding v6.2.2 (error 1201). As per a suggestion from Microsoft Support, deleted the old submission and created a new one. Submission was published with no issues.
FYI the UWP NuGet 6.2.2 was unpublished and it will be most likely replaced with a fixed version. Don't use it, because you won't be able to Restore it if you delte it from your NuGet cache.

having same issue and I accidently deleted "nuget/packages" because I read it was the solution but that didnt help either, should I just downgrade to 6.1.9 and then make app packages? @martinsuchan
@touseefbsb Here are the most recent comments about the availability of UWP 6.2.x package:
tl;dr Package 6.2.3 is currently available, only hidden and it's not recommended to use unless you really want to publish ARM64 version of your app. Package 6.2.4 should be released in early 2019.
https://github.com/Microsoft/dotnet/issues/931#issuecomment-446713087
When i downgrade my UWP project to 6.1.9 the app build without problems but it cannot start. I am getting
Exception thrown: 'System.TypeLoadException' in Unknown Module.
Could not load type 'System.Runtime.CompilerServices.IAsyncStateMachine' from assembly 'System.Runtime, Version=4.2.1.0 which does not occur on 6.2.2
6.2.3 solved the issue for me though
I'm was seeing the same issue but only during "create store packages". VS Build and F5 run of the app works fine, but "create store packages" gives me a bunch of these similar errors. But then I cleaned the solution and deleted all 'bin' and 'obj' folders, and now create store packages completed just fine! So might be a VS or temporary build state problem...
Solution (for me):
Click right on solution name in Solution Explorer in Visual Studio choose Manage Nuget Packages...
Go to Consolidation and update all projects with Microsoft.NETCore.UniversalWindowsPlatform to 6.2.3 version.
Build the solution in Release mode.
After that I have seen couple of errors.
I turn of Visual Studio and after reopen hit F5 and it was deployed to Remote machine without errors.
Magic, it just works... I don't know why...
Good luck.
This is fixed in both Microsoft.NETCore.UniversalWindowsPlatform 6.2.3 and 6.2.8.
Solution (for me):
Click right on solution name in Solution Explorer in Visual Studio choose Manage Nuget Packages...
Go to Consolidation and update all projects with Microsoft.NETCore.UniversalWindowsPlatform to 6.2.3 version.
Build the solution in Release mode.
After that I have seen couple of errors.
I turn of Visual Studio and after reopen hit F5 and it was deployed to Remote machine without errors.
Magic, it just works... I don't know why...
Good luck.
Funciono para m铆, s贸lo lo actualice, limpie la soluci贸n y recompile
Most helpful comment
Updating to System.Runtime.CompilerServices.Unsafe 4.5.2 should fix this for you. I've started an internal email thread to see if we can either fix it, or do something with the error message.