How is .Net Standard 2.0 and the SDK/tooling at 1.0 without UWP/UAP apps able to reference .Net Standard projects? Is UWP/UAP no longer a priority?
Just create a UWP project and reference a .NEt Standard 2.0 library and you get:
Project 'MyStd20Lib.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets 'UAP,Version=v10.0.10586'.
This is actively being worked on. Targeting VS 2017 version 15.4. Preview1 build should be available soon.
UWP is supporting netstandard2 in its next release.
what's mean "next release"?
The next release of UWP. You can read more here: https://blogs.msdn.microsoft.com/dotnet/2017/08/25/uwp-net-standard-2-0-preview/
VS 15.4 was released very recently, with Xamarin Forms 2.4, but I keep getting the same error.
I have a UWP app targetting the Fall Creators update (16299, both target and min. version), and a trivial .NET Standard 2.0 library. This is the result:
C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.Common.targets(87,5): error : Project 'ClassLibrary1.csproj' targets '.NETStandard,Version=v2.0'. It cannot be referenced by a project that targets 'UAP,Version=v10.0.16299'.
Note, I am using the Fall Creators Update.
@JunielKatarn I have the same problem. Did you solve it by any chance?
@Amenti No luck yet. It just doesn't work. Hope someone from the .NET team reads this.
[UPDATE] The feature DOES work, but not incrementally. If you get the same error message I did, you should fully rebuild the solution.
@JunielKatarn Thanks for the info. It does not help though. I even have this problem with a freshly created project with minimum and target version set to 16299. I did install the dotnet-sdk-2.0.0-win-x64.exe. Maybe something did not work out with the installation...
I found the problem. I had installed the .Net Core SDK separately from Visual Studio. After I uninstalled it and installed the .Net Crossplatform workload in the Visual Studio Installer it started to work.
@Amenti Thanks! That worked.
@Amenti Thanks I have been fighting that for hours.
@Amenti Didnt work for me.
FYI - the UWP workload has been fixed to pull in the required components for .NET Standard tooling such that you won't need to install the .NET Core workload anymore.
This now works, but in some cases I cannot debug .NET Standard 2.0 dlls. https://github.com/dotnet/standard/issues/621
I have latest vs 2017 version installed and I am still having the same problem, I cannot reference to a .net standard library project.
Using VS2017, I had to set my Minimum version to build 16299. Then the IDE automatically downloaded and installed the required SDK.
After compiling the errors went away.
Edit: For reference, it is the very first thing said on https://blogs.msdn.microsoft.com/dotnet/2017/08/25/uwp-net-standard-2-0-preview/ .
Prerequisites
In order to use .NET Standard 2.0 in UWP, you need to target Fall Creators Update (FCU) as the minimum version of your UWP project. That’s because .NET Standard 2.0 contains many APIs that require FCU to make them work in the context of the UWP execution environment, specifically AppContainer.
Projects using .NET Standard 2.0 must have a Minimum Version of Build 16299 or later.
I'm getting this same error when running Azure Devops Pipelines using image "vs2017-win2016."
My error is odd because it's saying I'm using a compatible version but the error is still there!
What gives?
I'm using pipline image vs2017-win2016 which says it's currently using 15.8.1+28010.2003 according to:
https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2017-Server2016-Readme.md
The yml step that fails is "NuGetCommand@2" - here's a snip of the yml
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: '**/MyProjectName.sln'
I've set my UWP target and min target versions to the same thing: Build 10.0.17763 so that's not the issue either.
Does this mean the pipeline image has its tools installed wrong per @Amenti 's comment?
Anyone else seeing this problem when building with Azure Devops Pipelines?
Update vs
Get Outlook for iOShttps://aka.ms/o0ukef
From: Andy Gikling notifications@github.com
Sent: Sunday, December 2, 2018 3:33 PM
To: dotnet/standard
Cc: Chris Bordeman; Author
Subject: Re: [dotnet/standard] UWP can't reference .Net Standard 2.0 projects?? (#462)
I'm getting this same error when running Azure Devops Pipelines using image "vs2017-win2016."
My error is odd because it's saying I'm using a compatible version but there error is still there!
What gives?
I'm using pipline image vs2017-win2016 which says it's currently using 15.8.1+28010.2003 according to:
https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2017-Server2016-Readme.mdhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fazure-pipelines-image-generation%2Fblob%2Fmaster%2Fimages%2Fwin%2FVs2017-Server2016-Readme.md&data=02%7C01%7C%7C71ba4f3d44344f0f274008d658956b85%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636793796102713773&sdata=kwmcWEmlqUfc0gsXXzDQZmsCEoqWYiA4YjpS9ax2y2c%3D&reserved=0
I've set my UWP target and min target versions to the same thing: Build 10.0.17763 so that's not the issue either.
Does this mean the pipeline image has its tools installed wrong per @Amentihttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAmenti&data=02%7C01%7C%7C71ba4f3d44344f0f274008d658956b85%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636793796102713773&sdata=5jG7Fr9V6J2zLPUnOhWjULSh%2Fj0yzQqVZOhBmRWoOa4%3D&reserved=0 's comment?
Anyone else seeing this problem when building with Azure Devops Pipelines?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fstandard%2Fissues%2F462%23issuecomment-443539515&data=02%7C01%7C%7C71ba4f3d44344f0f274008d658956b85%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636793796102713773&sdata=cyla%2BCHMGBsdP1rH5eRMYdF1weavYbXv72pZ6frw0BU%3D&reserved=0, or mute the threadhttps://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAB02aXRdIZ_glRB3Qcoesn1d5yb38Ifwks5u1DkXgaJpZM4O-5dt&data=02%7C01%7C%7C71ba4f3d44344f0f274008d658956b85%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636793796102713773&sdata=LCgIOyhqb9j1puEiKXmcMs6e2KJTQwf9fxzmgFJrwlE%3D&reserved=0.
...Chirs, bud... The tools are up to date...
As I previously mentioned, Microsoft maintains the pipeline's image and updates it monthly.
Got any other sweet ideas?
Think you need some late version of Windows 10 for this to work. You on Insiders?
Most helpful comment
Using VS2017, I had to set my Minimum version to build 16299. Then the IDE automatically downloaded and installed the required SDK.
After compiling the errors went away.
Edit: For reference, it is the very first thing said on https://blogs.msdn.microsoft.com/dotnet/2017/08/25/uwp-net-standard-2-0-preview/ .