简体   繁体   English

Visual Studio 2015:无法解析目标框架的 mscorlib

[英]Visual Studio 2015: Could not resolve mscorlib for target framework

I am trying to update a service reference but I'm getting the following error:我正在尝试更新服务参考,但出现以下错误:

Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'.无法为目标框架“.NETFramework,Version=v4.0”解析 mscorlib。 This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.如果未安装目标框架或框架名字对象格式不正确,就会发生这种情况。

  • .NET v4.0 is installed. .NET v4.0 已安装。
  • Both "Update service Reference" and "Configure Service Reference" give the same error. “更新服务参考”和“配置服务参考”都给出相同的错误。

i opened the project file in a notepad editor and removed this.我在记事本编辑器中打开项目文件并将其删除。

Target Name="EnsureNuGetPackageBuildImports" /> bla bla bla目标名称="EnsureNuGetPackageBuildImports" /> bla bla bla

This can happen if you have a bad service reference configuration如果您的服务参考配置错误,就会发生这种情况

try the following尝试以下

  1. open csproj file in any text editor在任何文本编辑器中打开 csproj 文件
  2. then remove all references to any soap service or its files然后删除对任何肥皂服务或其文件的所有引用
  3. save and open the project in visual studio在 visual studio 中保存并打开项目

In my project, the nuget packages were not being restored correctly due to some connectivity issues.在我的项目中,由于某些连接问题,nuget 包未正确恢复。 Once the nuget packages have been restored successfully, the error went away.一旦成功恢复了 nuget 包,错误就消失了。

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

相关问题 Visual Studio 2010:无法解析目标框架“.NETFramework,Version=v4.0”的 mscorlib - Visual Studio 2010: Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0' 无法解析目标框架“.NETFramework,Version=v4.6.1”的 mscorlib - Could not resolve mscorlib for target framework '.NETFramework,Version=v4.6.1' nhibernate无法使用LeftOuterJoin解析属性(仅在Visual Studio 2015中) - nhibernate could not resolve property (Only in Visual Studio 2015) with a LeftOuterJoin Visual Studio 2015没有菜单“目标框架” - Visual Studio 2015 does not have menu “Target framework” 更改目标框架会导致Visual Studio 2015错误 - changing target-framework causes error in visual studio 2015 如何解决 Visual Studio 和 Xamarin Studio 中 2 个 mscorlib 版本之间的冲突? - How to resolve the conflict between 2 mscorlib versions in Visual Studio and Xamarin Studio? Visual Studio中的“目标框架” - “Target Framework” in Visual Studio 无法在Visual Studio 2015中定位.Net 2.0 - Cannot target .Net 2.0 in Visual Studio 2015 Visual Studio 2015,Xamarin和目标设备 - Visual Studio 2015, Xamarin and target devices 无法显示Visual Studio 2015设计器 - Visual Studio 2015 Designer could not be shown
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM