“生成资源"任务 CLR2 运行时错误 [英] "GenerateResource" task CLR2 runtime error
问题描述
我的应用程序不断收到此错误(顺便说一下,我使用的是 VS 2013、VB.NET 和 Windows 8.1):
<块引用>无法运行GenerateResource"任务,因为 MSBuild 无法创建或连接到具有运行时CLR2"和体系结构x86"的任务主机.请确保 (1) 请求的运行时和/或体系结构在计算机上可用,以及 (2) 所需的可执行文件C:Program Files (x86)MSBuild12.0inMSBuildTaskHost.exe"存在并且可以运行.
该应用程序适用于 .NET 3.5(3.5 及更低版本让我出现此错误).我尝试再次运行该应用程序.有时,它有效;有时,错误又回来了.
我已经尝试在 Google 上查找答案,结果他们给我的答案是:您构建的用户名太长"(他们说 20 个或更多字符会导致错误),但事实并非如此.我的用户名只有 5 个字符.无论如何,我认为我的构建用户名的长度与它没有任何关系;毫无意义.
有谁知道3.5及更低版本有什么问题?谢谢.
这解决了我机器上的问题:
要解决它,请转到您的 csproj 文件并在默认属性组下添加以下行:
...<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost></PropertyGroup>
在此处找到.>
My app keeps getting this error (I'm using VS 2013, VB.NET, and Windows 8.1, by the way):
Could not run the "GenerateResource" task because MSBuild 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)MSBuild12.0inMSBuildTaskHost.exe" exists and can be run.
The app is for .NET 3.5 (3.5 and lower versions get me this error). I try to run the app again. Sometimes, it works; sometimes, the error comes back.
I already tried looking up for answers at Google and the answer they gave me turned out to be: "Your build's username is too long" (they said that 20 characters or more cause the error), but it's not true. My user name is 5 characters only. Anyway, I don't think my build's username's length has anything to do with it; it makes no sense.
Does anyone know what is wrong with 3.5 and lower versions? Thank you.
This fixed the issue on my machine:
To resolve it, go to your csproj file and add the following line under the default property group:
<PropertyGroup>
...
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
</PropertyGroup>
Found here.
这篇关于“生成资源"任务 CLR2 运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!