看起来像MSVS 11.0 Beta破坏了MSVS 10.0的安装

Loo*_*oom 14 .net c# msbuild visual-studio-2010 visual-studio-2012

安装MSVS 11Beta后,我遇到了MSVS 10的编译问题.现在,当我在MSVS 10中编译我的C#项目(在MSVS 10中创建的项目;目标框架:3.5)时,我得到错误MSB4216,MSB4028输出窗口中有以下文本:

1>Task "GenerateResource" skipped, due to false condition; ('%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' != 'CLR2') was evaluated as ('Resx' == 'Resx' and '' != 'false' and 'CLR2' != 'CLR2').
1>Task "GenerateResource"
1>  Launching task "GenerateResource" from assembly "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" in an external task host with a runtime of "CLR2" and a process architecture of "x86".
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2199,5): error MSB4216: Could not run the "GenerateResource" task because we could not create or connect to a task host with runtime "CLR2" and architecture "x86".  Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NetFX 4.0 Tools\MSBuildTaskHost.exe" exists.
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(2217,7): error MSB4028: The "GenerateResource" task's outputs could not be retrieved from the "FilesWritten" parameter. Object does not match target type.
1>Done executing task "GenerateResource" -- FAILED.
Run Code Online (Sandbox Code Playgroud)

我该如何解决这些错误?

编辑:

  1. 提到文件"C:\ Program Files(x86)\ Microsoft SDKs\Windows\v8.0A\bin\NetFX 4.0 Tools\MSBuildTaskHost.exe"存在.
  2. C++项目正在顺利进行.
  3. 重新安装VS10无法解决问题.
  4. 这是GenerateResource必须编译resx文件的任务,但会生成异常:

<!-- But we can't use those parameters if we're targeting 3.5, since we're using the 3.5 task -->

<GenerateResource
    Sources="@(EmbeddedResource)"
    UseSourcePath="$(UseSourcePath)"
    References="@(ReferencePath)"
    AdditionalInputs="$(MSBuildAllProjects)"
    NeverLockTypeAssemblies="$(GenerateResourceNeverLockTypeAssemblies)"
    StateFile="$(IntermediateOutputPath)$(MSBuildProjectFile).GenerateResource.Cache"
    StronglyTypedClassName="%(EmbeddedResource.StronglyTypedClassName)"
    StronglyTypedFileName="%(EmbeddedResource.StronglyTypedFileName)"
    StronglyTypedLanguage="%(EmbeddedResource.StronglyTypedLanguage)"
    StronglyTypedNamespace="%(EmbeddedResource.StronglyTypedNamespace)"
    StronglyTypedManifestPrefix="%(EmbeddedResource.StronglyTypedManifestPrefix)"
    PublicClass="%(EmbeddedResource.PublicClass)"
    OutputResources="@(EmbeddedResource->'$(IntermediateOutputPath)%(ManifestResourceName).resources')"
    MSBuildRuntime="$(GenerateResourceMSBuildRuntime)"
    MSBuildArchitecture="$(GenerateResourceMSBuildArchitecture)"
    Condition="'%(EmbeddedResource.Type)' == 'Resx' and '%(EmbeddedResource.GenerateResource)' != 'false' and '$(GenerateResourceMSBuildRuntime)' == 'CLR2'">
Run Code Online (Sandbox Code Playgroud)
  1. 我试图调试 MSBuild脚本(.csproj).在致命GenerateResource任务之前,我检查了所有属性项目."8.0A"没什么,但只有"7.0A"

Loo*_*oom 17

有一种丑陋的方法可以解决这个问题:重命名文件夹"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A".我讨厌接受这个答案.


Chr*_*ian 8

你的用户名多长时间了?

当用户名长度为20个字符时,似乎存在错误.如果您的用户名是19个字符或更少,它可以正常工作.

我在连接上打开了一个问题.

编辑: 您是否尝试将环境变量设置DisableOutOfProcTaskHost为true,如连接问题中所建议的那样,对我有用.