1
votes

Previously I was having a class library targeting .Net Standard 1.4, but I upgraded it to .Net Standard 2.0 and also updated UWP class library to target SDK 16299 but on compiling the UWP Class library project it is giving below error:

The type 'DateTime' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Seems like I am missing something, but can't actually figure out what it is, also tried modifying .csproject by adding below line but that also didn't worked.

 <ItemGroup> <Reference Include="netstandard" /> </ItemGroup>
1
min/target version must be both Build 16299. also add this to the csproj: <PackageReference Include="NETStandard.Library"> <Version>2.0.1</Version> </PackageReference>magicandre1981
Does the above comment works in your side?Nico Zhu - MSFT
@magicandre1981 Thanks, I tried your suggestion but that didn't worked. What I tried is installing Microsoft.NETCore.Runtime.CoreCLR package and upgrading Microsoft.NETCore.UniversalWindowsPlatform to latest version did worked.Dishant
post your steps as answermagicandre1981

1 Answers

0
votes

After investigating four couple of days, finally I was able to build the solution. Below are the steps that I followed to make it work:

1> Installed Microsoft.NETCore.Runtime.CoreCLR from Nuget

2> Upgrade to the latest version of Microsoft.NETCore.UniversalWindowsPlatform

Still I am not sure why I need CoreCLR library, would appreciate if anyone have explanation for it. Right now am okay as far as my project is building.