.NET 4.5.1预览支持在Visual Studio 2012

问题描述:

首先让我增加一些上下文的错误,我得到的,我已经安装了.NET 4.5.1预览和我在VS 2012注意到的第一件事是,.NET 4.5.1没有在可用的框架中列出。我不确定这是否是正确的行为,因为这只是升级到4.5,所以我想VS 2012应该列出它。.NET 4.5.1预览支持在Visual Studio 2012

而且,现在如果我安装了VS 2013预览,升级我的项目.NET 4.5.1和VS开解2012新.NET版本又出现了,所以我不知道这是一个错误的VS 2012或不是?好了,现在我有.NET 4.5.1在VS 2012,当我尝试建立一个项目,我收到以下错误

Error 3 The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified. D:\Projects\MyProject\Master\Source\.nuget\nuget.targets 71 9 MyProject.Core.Modules 

NuGet.targets报告线

<SetEnvironmentVariable EnvKey="VisualStudioVersion" 
EnvValue="$(VisualStudioVersion)" Condition=" '$(VisualStudioVersion)' 
!= '' AND '$(OS)' == 'Windows_NT' " /> 

这在我看来,出于某种原因,VS 2012无法解析路径或程序集,所以我不确定是否应该修复NuGet.targets中的某些内容,或者它是Visual Studio的东西,还是任何想法?

感谢

+0

上的咖啡小杯后,我发现我不得不升级_NuGet.targets_。的 – khorvat

+0

可能重复[构建上TFS 2013失败,但没关系本地](http://stackoverflow.com/questions/20661943/build-on-tfs-2013-failed-but-okay-locally) – Korayem

大厦的.NET Framework 4.5.1应用程序在Visual Studio 2012年您需要或者安装Visual Studio 2013 PreviewWindows SDK for Windows 8.1 Preview支持,以获得.NET框架4.5 .1在与Visual Studio 2012相同的机器上预览目标包,以使用.NET Framework 4.5.1预览版构建应用程序。

谢谢
Nithya [MSFT]

+0

Microsoft是否生成工具2013(http://www.microsoft.com/en-au/download/details.aspx?id=40760)做同样的工作吗? –

为了解决这个问题,我不得不升级NuGet.targets并更改以下两行

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> 
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll"> 

<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll"> 
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll"> 

而且它会很高兴得到一些与.NE有关的答案直到我与自己安装了VS 2013

闲话家常牛逼4.5.1预览没有出现在VS 2012。

我解决了.csproj的文件改变ToolsVersion。

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 

<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 
+2

所以你不得不改变_ToolsVersion_回到** 4.0 **,以获得** VS .NET 2012 **中的**。NET 4.5.1 **? – khorvat

这里的博客中,微软在这个题目中写道。

Building apps with the .NET Framework 4.5.1 Preview in Visual Studio 2012