简体   繁体   English

.NetCoreApp 1.1-默认的Visual Studio 2017 .NET Core项目已损坏?

[英].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. 我今天开始尝试尝试掌握新的.NET Core框架。 So I installed Visual Studio 2017 Enterprise and .NET Core Workload as per the following link: 因此,我根据以下链接安装了Visual Studio 2017 Enterprise和.NET Core Workload:

https://www.microsoft.com/net/core#windowsvs2017 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 : 我以为我会乐于创建类库,所以我创建了一个新的.NET Core库项目,该项目默认为目标框架.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. 现在,创建解决方案时,Nuget软件包还原对于每个软件包都将失败,甚至无法正确引用系统名称空间。 FYI, the full error output for the restore can be found here (pastebin). 仅供参考,可以在此处找到完整的还原错误输出(pastebin)。

Now if I can change the target framework to .NETCoreApp 1.0 then the errors clear themselves up. 现在,如果我可以将目标框架更改为.NETCoreApp 1.0,则错误会自行清除。 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? 因此,这对我自己来说是一个核心nOOb的困惑-我看到1.1可用了,但是我可以将其用于类库还是应该以1.0为目标?

Also, my nuget source is the following: 另外,我的nuget来源如下:

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

UPDATE: 更新:

I do seem to have the 1.1 SDK installed: 我似乎确实安装了1.1 SDK: 在此处输入图片说明

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 : 最后,我卸载所有.NET SDK引用(Windows系统: 添加或删除程序 ),使用使用Visual Studio安装程序Visual Studio 2017年的工作量,并重新安装了.NET的核心:

在此处输入图片说明

ReSharper Users: ReSharper用户:

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...." . 我必须打开我创建的解决方案,重新保存它(出于某种原因),关闭Visual Studio,然后重新打开解决方案-这个已解决的问题是到处都是红色的波浪线,并且出现了错误的错误“无法引用...。 “

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Visual Studio 2017 中通过 postbuild 事件构建 .net 核心项目 - Build .net core project by postbuild event in visual studio 2017 将新 .NET CORE 加载到 Visual Studio 2017 c# .NET CORE 项目中的问题 - Problem of loading new .NET CORE into Visual Studio 2017 c# .NET CORE project Visual Studio 2017 (.NET Core) 中的自动版本控制 - Auto Versioning in Visual Studio 2017 (.NET Core) 在 Visual Studio 2017 中使用 .NET Core 5.0 - Use .NET Core 5.0 in Visual Studio 2017 Visual Studio 2019 - msvsmon.exe 意外退出。 .net 核心 1.1 项目将中止调试 - Visual Studio 2019 - msvsmon.exe unexpectedly exited. Debugging will be aborted with .net core 1.1 project .net 标准和 .net 核心之间的 Visual Studio 2017 项目参考支持 - Visual Studio 2017 project reference support between .net standard and .net core 如何在Visual Studio 2017 RC3中获取C#(。net core)项目目录路径? - How to get C# (.net core) project directory path in Visual Studio 2017 RC3? 如何使用 BuildManager 在 Visual Studio 2017 (MsBuild 15) 上构建 .Net Core 项目或解决方案 - How to use BuildManager to build .Net Core project or solution on Visual Studio 2017 (MsBuild 15) .NET Core 2.1:如何在Visual Studio 2017中进行调试期间触发在项目文件中定义的复制任务? - .NET Core 2.1 : How to trigger Copy task defined in the project file during debugging in the Visual Studio 2017? 新的.net核心视觉工作室2017项目nuget恢复CI构建定义 - new .net core visual studio 2017 project nuget restore in CI build definition
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM