如何在VS.NET项目中更改Resgen命令行? [英] How to change the Resgen command line in a VS.NET project?

查看:124
本文介绍了如何在VS.NET项目中更改Resgen命令行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ResGen 在Visual Studio .NET 2010内部构建.NET 2.0项目的过程中调用,

Having an issue with a ResGen call during a build of a .NET 2.0 project from within Visual Studio .NET 2010, this thread suggests:

将此添加到您的MSBUILD命令行中: /p:ResGenExecuteAsTool=true;ResGenToolArchitecture=ManagedIL;ResGenTrackerSdkPath="%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64"

Add this to your MSBUILD command-line: /p:ResGenExecuteAsTool=true;ResGenToolArchitecture=ManagedIL;ResGenTrackerSdkPath="%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64"

我已经搜索了数小时,但都没有成功,试图从我的Visual Studio .NET项目中找到一种方法来实现此目的.

I've searched for hours without success trying to find a way to do this from within my Visual Studio .NET project.

因此,我的问题是:

如何在Visual Studio 2010中更改.NET 2.0(类库)项目的MSBUILD命令行?

How can I change the MSBUILD command line of a .NET 2.0 (class library) project in Visual Studio 2010?

我不担心更改我的".csproj"文件,如果可能的话,我宁愿更改Visual Studio附带的MSBuild文件.

I have no fear changing my ".csproj" file, I would prefer not to change MSBuild files that were shipped with Visual Studio, if this is possible.

更新和解决方案:

感谢Oded的评论答案,我添加了以下两行:

Thanks to Oded's comment and answer, I added the following two lines:

<ResGenTrackerSdkPath>%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64</ResGenTrackerSdkPath>
<TrackFileAccess>false</TrackFileAccess>

就在我的".csproj"文件的第一个<PropertyGroup>部分中(即第3行之后).这样就可以成功编译文件!

right inside the very first <PropertyGroup> section of my ".csproj" file (i.e. after line 3). This made the file compile successfully!

我现在检查并查看它是否也成功运行.

I now check and see whether it also runs successfully.

推荐答案

就像MSBuild中的所有属性一样,您可以将通过命令行传递的内容添加到XML元素的项目文件中.

Like all properties in MSBuild, what you can pass in through the command line can be added in the project file in XML elements instead.

例如:

<ResGenTrackerSdkPath>%programfiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64</ResGenTrackerSdkPath>

并且:

<ResGenExecuteAsTool>true</ResGenExecuteAsTool>

等...

这篇关于如何在VS.NET项目中更改Resgen命令行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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