This article is mainly for the details of the visual Studio 2017 create. NET Standard Class Library compilation error reasons and solutions, with a certain reference value, interested in small partners can refer to
The official version has been released last month, from then to now often receive update tips, estimating the problem is not many! The most fascinating thing to me, of course, is. NET Standard and. NET Core.
Just recently contacted. NET Standard project, a new class library directly compiled but error!! Immediately mood is not very good, to its interest greatly discounted!
If it's a beginner's estimate, it's going to vomit! As a veteran or calm down to see why.
Look at the last one:
The asset file "C:\users\newblifes\documents\visual Studio 2017\projects\testdemo\testdemo\obj\project.assets.json" could not be found. Run the NuGet package restore to generate this file. E:\ProgramData\VS2017\MSBuild\Sdks\Microsoft.NET.Sdk\build\Microsoft.NET.Sdk.targets 92
This should be the. NET Standard package is not restored, resulting in errors that cannot be found in the System namespace.
There is no netstandard.library under the dependencies, but there is no problem with the project file settings:
The first response is to install the Netstandard.library package, which is not possible without this package as a. NET Standard class library, but why can't I automatically restore the package?
Because the new installation of Visual Studio 2017 was not set up, it suddenly occurred to me that it was not a setup issue for Visual Studio package management?
Open the tab really did not tick!! The original default settings changed, Visual Studio 2015 by default is on the hook!!
Set the following preferences as follows:
Compile the project again:
The result of the wish came out, this time can be relieved to do things.
Summarize
New installation of Visual Studio 2017 friends, before using remember to take a good look at the Settings tab, and add the relevant settings, or error can delay a lot of kung Fu, but also touch the head!