“生成资源"任务 CLR2 运行时错误 [英] "GenerateResource" task CLR2 runtime error

查看:30
本文介绍了“生成资源"任务 CLR2 运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序不断收到此错误(顺便说一下,我使用的是 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆