Visual Studio 2017 creates the. net standard class library compilation error cause and solution, 2017 standard
The official version has been Release last month. From then on, we often receive update prompts. It is estimated that there are still many problems! Of course, the most attractive ones are. net standard and. net core.
I just recently got in touch with the. net standard project. I just created a new class library, but an error occurred while directly compiling it !! I am in a bad mood, and I am very interested in it!
If you are a newbie, you will immediately vomit! As a veteran, let's take a look at the reason.
Check the last item:
The asset file "c: \ users \ newblifes \ documents \ visual studio 2017 \ Projects \ TestDemo \ obj \ project. assets. json" cannot be found ". Run the NuGet package to restore to generate this file. E: \ ProgramData \ VS2017 \ MSBuild \ Sdks \ Microsoft. NET. Sdk \ build \ Microsoft.NET.Sdk.tar gets 92
This should be because the. net standard package is not restored, resulting in an error that cannot be found in the System namespace.
There is no NETStandard. Library Under the dependencies, but the project file settings are correct:
The first reaction is to install the NETStandard. Library package. As the. net standard class Library, this package cannot be absent, but why cannot the package be restored automatically?
The newly installed Visual Studio 2017 is not set. I suddenly remembered whether it was a problem with Visual Studio package management settings?
The tab is not checked !! The default settings have changed. Visual Studio 2015 is checked by default !!
Set as follows:
Re-compile the project:
The expected result has appeared, so you can work with peace of mind.
If you are new to Visual studio 2017, remember to take a good look at the settings tab and add relevant settings before using it. Otherwise, it may take a lot of effort to get it wrong!
For more information, click Visual Studio 2017 development and usage tutorial. for visual studio installation tutorial, click Visual Studio installation user manual.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.