简体   繁体   中英

Error Upgrading To .NET 4.5

I'm trying to upgrade from VS2010 .NET 4 to VS2012 .NET 4.5 and I'm getting the following error in each Project that I've set to .NET 4.5 when they try to build.

The expression "[Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries(.NETFramework, ?, '', '')" cannot be evaluated. Version string portion was too short or too long.

I can't find any references to this in my code and the msdn reference for the function doesn't provide any hints ( http://msdn.microsoft.com/en-us/library/hh135279.aspx ).

Anyone seen this before or know the solution?

Edit

The solution listed here doesn't seem to work. http://social.msdn.microsoft.com/Forums/da-DK/vseditor/thread/8ca4a9b0-742d-487d-ab8c-6c3a80cffd40

经过多次尝试,包括重新启动机器和视觉工作室,这开始工作没有明显的原因。

Unload your project and remove the below tag from your .csproj file:

<TargetFrameworkVersion></TargetFrameworkVersion>

and reload your project again, it works for me.

I had the same problem when upgrading from 4.6.1 to 4.7.2 framework. I had a big solution with many projects. This error turned out when building the last project (win application), which had the correct <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> .

The cause of the problem were the other projects, used by the win app project. They had incorrect framework versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM