简体   繁体   中英

.NetCoreApp 1.1 - Default Visual Studio 2017 .NET Core Project Broken?

I'm starting today to try and get to grips with the new .NET Core framework. So I installed Visual Studio 2017 Enterprise and .NET Core Workload as per the following link:

https://www.microsoft.com/net/core#windowsvs2017

I thought I would give a go at creating Class Library, so I created a new .NET Core Library project, which defaults to target framework .NETCoreApp 1.1 :

以下摘自项目属性

Now when the solution is created, the Nuget package restore fails for every package and not even System namespace is referenced correctly. FYI, the full error output for the restore can be found here (pastebin).

Now if I can change the target framework to .NETCoreApp 1.0 then the errors clear themselves up. So this is the confusion for myself a Core nOOb - I see 1.1 is available, but can i use it for Class Libraries or should i be targeting 1.0?

Also, my nuget source is the following:

https://api.nuget.org/v3/index.json

UPDATE:

I do seem to have the 1.1 SDK installed: 在此处输入图片说明

In the end I uninstalled all of the .NET SDK references (Windows: Add or Remove Programs ) and re-installed .NET Core using the Visual Studio 2017 workload using the Visual Studio Installer :

在此处输入图片说明

ReSharper Users:

I had to open the Solution I have created, re-save it (for some reason), close Visual Studio, then re-open the Solution - this fixed issues with red squiggly lines everywhere and incorrect errors with "Cannot reference...." .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM