Why is an error occurred while creating the. net standard class library in Visual Studio 2017, 2017 standard

Source: Internet
Author: User

Why is an error occurred while creating the. net standard class library in Visual Studio 2017, 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.

 

Summary

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!


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.