您的位置:首页 > 其它

win7 64位系统使用VS2010生成时出现中文目录乱码问题的解决方法

2014-08-30 16:03 1121 查看
原文连接:/article/5292509.html

在64位的Windows 7下,用VS2010编译4.0以前的.Net项目会有问题。原因么,是一个叫Resgen.exe的玩意儿,是跑在64位环境下的,当他试图加载32位的可执行代码时,就会执行失败:

Failed to execute command:

""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" (此处省略···)

解决方法:

按照官方的解决方法,直接翻译过来

1. 关闭Visual Studio。

2. 在Visual Studio Tools子目录,以管理员身份运行Visual Studio Command Prompt (2010),切换目录到"<system_drive>:\Program Files (x86)\Microsoft SDKs\Windows\v<x.xx>\bin\”. ( 我的是v7.0A )

3. 执行命令:

corflags /32bit+ ResGen.exe /force

4. 在记事本中打开 <project_name>.csproj 文件

5. 添加这个属性在PropertyGroup下面: <ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>,然后保存文件。

再次尝试编译,一切OK!

参考链接:

MSBuild 4.0 or Visual Studio 2010 may fail to compile a 32-bit application
targeted for .Net Framework 3.5, 3.0 or 2.0 on x64 machine.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐