Visual Studio Update 2017 15.3.1强制使用ASP.NET Core SDK 2.0,然后找不到“引用程序集". [英] Visual Studio update 2017 15.3.1 forces ASP.NET Core SDK 2.0, which then doesn't find "reference assemblies"

查看:136
本文介绍了Visual Studio Update 2017 15.3.1强制使用ASP.NET Core SDK 2.0,然后找不到“引用程序集".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与这个问题有关: Visual Studio 15.3.1找不到核心更新后的DLL

我必须执行相同的过程,损坏的VS设置意味着我运行安装程序并将VS 2017更新为15.3.1.从那时起,像上面提到的问题一样,如果没有安装.NET Core SDK 2.0,我的主项目将无法运行.

I've had to do the same process, a corrupt VS settings meant I ran the installer and updated VS 2017 to 15.3.1. Since then, my main project wouldn't run without having the .NET Core SDK 2.0 installed, like in the referenced question above.

我已经安装了SDK 2.0,它解决了该错误,该项目得以构建并运行,但随后立即抛出InvalidOperationException: Can not find assembly file Microsoft.CSharp.dll at 'build paths'

I've installed the SDK 2.0, which resolved the error, the project builds and run but then immediately throws InvalidOperationException: Can not find assembly file Microsoft.CSharp.dll at 'build paths'

如果我从C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1目录(我使用的是面向整个框架4.6.1的.NET Core应用程序)中将该DLL拖放到bin文件夹中,则它将移至丢失的mscorelib.dll上,然后继续

If I drop that DLL from my C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1 directory (I'm using a .NET Core app targeting the full framework 4.6.1) into the bin folder, it then moves onto mscorelib.dll that's missing, and then on-and-on.

在将整个批次转储到bin输出文件夹之前,我假设由于某种原因,新安装程序找不到新的SDK文件和/或引用程序集文件夹?

Before just dumping the whole lot into the bin output folder, I'm assuming that for some reason the new setup doesn't find the new SDK files and / or reference assemblies folder?

有没有解决的办法?这也将反映到生产环境中.

Is there a fix for this? That will also reflect into production environments.

GitHub上存在相同的问题: https://github.com/aspnet/Home/issues/2129 链接到 https://github.com/dotnet/sdk/issues/1488

There's the same issue on GitHub here: https://github.com/aspnet/Home/issues/2129 which links to https://github.com/dotnet/sdk/issues/1488

问题是相同的,什么都没有升级-只有VS更新到15.3.1,然后抛出The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. Please install version 2.0 or higher of the .NET Core SDK.错误,而对项目没有其他更改

The issue is the same, nothing has been upgraded - only VS updated to 15.3.1, which has then thrown the The version of Microsoft.NET.Sdk used by this project is insufficient to support references to libraries targeting .NET Standard 1.5 or higher. Please install version 2.0 or higher of the .NET Core SDK. error with no other changes to the project

推荐答案

花了一天的时间之后,按照链接的GitHub问题在这里:

After spending the day on this, as per the linked GitHub issue here: https://github.com/dotnet/sdk/issues/1488 the current solution is to add the following to your .csproj file, in the main <PropertyGroup> node:

<DependsOnNETStandard>netstandard1.5</DependsOnNETStandard>

这里有一些针对目标对象的更多信息: https://docs.microsoft.com/en-us/dotnet/标准/网络标准

There's some more information on what to target here: https://docs.microsoft.com/en-us/dotnet/standard/net-standard

当您更新到VS 2017 15.3及更高版本时,它可能仅适用于针对整个框架(在本例中为4.6.1)的.netcore项目.

It may be only for .netcore projects, targeting the full framework (4.6.1 in this case), when you update to VS 2017 15.3 and above.

如果有更好的解决方案,我将更新答案以反映出来.

If a better fix comes along, I'll update the answer to reflect it.

这篇关于Visual Studio Update 2017 15.3.1强制使用ASP.NET Core SDK 2.0,然后找不到“引用程序集".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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