The publish target fails for uap10.0
When a project includes the uap10.0 target framework, msbuild /t:publish fails with:
C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(280,5): error NETSDK1005: Assets file 'C:\Temp\MSBuildSDKExtrasTest\obj\project.assets.json' doesn't have a target for '.NETCore,Version=v5.0'. Ensure that restore has run and that you have included 'netcore50' in the TargetFrameworks for your project.
Did you run restore first? Either as msbuild /t:restore or in one command msbuild /restore /t:publish
Yes, I ran restore first.
do you have a simple repro that you can share?
Default .NET Standard project with MSBuild.Sdk.Extras and uap10.0 added to <TargetFrameworks>:
<Project Sdk="MSBuild.Sdk.Extras/1.6.61">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;uap10.0</TargetFrameworks>
</PropertyGroup>
</Project>
Then just do msbuild /t:restore;publish
unfortunately publish and restore targets cannot be combined in the same line like that. You either need to call msbuild /t:restore first, or use the /restore switch instead like msbuild /restore /t:publish.
I've tried all the combinations of doing a restore first, then a publish, but I always get this error. This only happens for uap10.0.