nuget - Visual Studio 2017网站菜单 "Enable C# 6/VB 14"无法加载Nuget包

标签 nuget visual-studio-2017 roslyn system-codedom-compiler

有一段时间,每当我单击网站菜单“启用 C# 6/VB 14”时,我都会收到一条异常消息,指出在以下主要资源中找不到“Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.2” ): "C:\Program Files (x86)\Microsoft Web Tools\Packages"

我检查该文件夹,发现它已升级到版本 1.0.3。 (C:\Program Files (x86)\Microsoft Web Tools\Packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3)

如何使菜单再次完好无损,以便指向正确的版本?

最佳答案

How can I bring the menu again intact in order to point to the correct version?

如果您想再次显示菜单,您应该从您的网站项目中卸载软件包Microsoft.CodeDom.Providers.DotNetCompilerPlatform”。

enter image description here

然后指向正确的版本。

此外,如果您想解决“找不到软件包 Microsoft.CodeDom.Providers.DotNetCompilerPlatform 1.0.2”错误...,您可以使用 nuget.org 下载该软件包版本1.0.2。然后将其设置到文件夹C:\Program Files (x86)\Microsoft Web Tools\Packages\。在这种情况下,您将永远不会得到该文件启用“启用 C# 6/VB 14”时出错。

关于nuget - Visual Studio 2017网站菜单 "Enable C# 6/VB 14"无法加载Nuget包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45659533/

相关文章:

c++ - VS2017模板特化报错cannot convert from 'Class *(__cdecl *)(Args...)' to 'Class *(__cdecl *)(Args...)'

c# - 什么是 Roslyn 中的 PatternSyntax

asp.net - 从 ASP.NET 网站编译代码

continuous-integration - 是否有可能让 NuGet.exe 在与 Visual Studio 断开连接的情况下运行?

f# - 无法加载使用 .NET Core 编写的 nuget 包

visual-studio - visual studio : get list of NuGet packages updates for solution, 纯文本

c++ - Visual Studio 可以通过 "Go To Definition"找到标识符的定义,但编译器会抛出 "identifier not found"(CS3861)

javascript - VS2017 Javascript 智能感知

c# - 构建一个 web 项目破坏了解决方案中第二个的编译版本

visual-studio-2017 - Nuget 输入不是有效的 Base-64 字符串,因为它包含非 Base 64 字符、超过两个填充字符