gpt4 book ai didi

c# - 看起来 MSVS 11.0 Beta 破坏了 MSVS 10.0 安装

转载 作者:可可西里 更新时间:2023-11-01 07:52:22 29 4
gpt4 key购买 nike

安装 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.

如何修复这些错误?

编辑:

  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'">
  1. 我试过debug MSBuild 脚本 ( .csproj )。就在致命的GenerateResource之前任务 我检查了所有属性项目。没有“8.0A”只有“7.0A”

最佳答案

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

关于c# - 看起来 MSVS 11.0 Beta 破坏了 MSVS 10.0 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10247337/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com