我的 Visual Studio 中缺少 .NET Core 2.0 [英] .NET Core 2.0 missing from my Visual Studio

查看:29
本文介绍了我的 Visual Studio 中缺少 .NET Core 2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我已经安装了官方的 .NET Core 2.0 SDK,当我在 Visual Studio 中时,我收到了大量错误并且没有列出目标框架:(

So I've installed the official .NET Core 2.0 SDK and when I'm in Visual Studio i get heaps of errors and the target framework is not listed :(

好像没有安装 .NET Core 2.0.

It's like .NET Core 2.0 isn't installed.

这里是 .csproj 文件:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Folder Include="wwwroot" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
  </ItemGroup>

</Project>

此外,dotnet --version 返回 2.0.0

所以.. 有没有我遗漏的安装工具?

so .. is there some install tooling I'm missing?

这是我来自 VS 的系统信息:

Here's my system info from VS:

Microsoft Visual Studio Community 2017 
Version 15.3.1
VisualStudio.15.Release/15.3.1+26730.8
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Community

Visual Basic 2017   00369-60000-00001-AA912
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA912
Microsoft Visual C# 2017

Application Insights Tools for Visual Studio Package   8.8.00712.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30726.0
ASP.NET and Web Tools 2017

ASP.NET Core Razor Language Services   1.0
Provides languages services for ASP.NET Core Razor.

ASP.NET Template Engine 2017   15.0.30726.0
ASP.NET Template Engine 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50601.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30728.0
Azure App Service Tools v3.0.0

... rest snipped.

推荐答案

啊!

我的解决方案的根目录中有以下 global.json:

I had the following global.json in the root of my solution:

{
  "projects": [ "src", "tests" ],
  "sdk": {
    "version": "1.0.4"
  }
}

所以我不得不将版本从 1.0.4 更改为 2.0.0 然后关闭/重新打开解决方案.

So I had to change the version from 1.0.4 to 2.0.0 and then close/re-open the solution.

问题解决了:)

这篇关于我的 Visual Studio 中缺少 .NET Core 2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆