win7系统使用engine进行开发报错,“未能加载文件或程序集”

使用vs2010arcengine 开发winfrom应用,新建了uc,拖了几个控件后,编译,报未能加载文件或程序集“XX…/../../”或它的某一个依赖项。试图加载格式不正确的程序。

问题原因:这个是因为在64位机器上VS2010不能够编译32位程序在net3.53.0或者2.0框架下。

那么如何解决这个问题呢?

步骤:

1、关闭所有VS程序实例。

 2、在VisualStudio Tools工具下,进入到命令提示选项。

3、更改目录进入<system_drive>:\ProgramFiles (x86)\Microsoft SDKs\Windows\v<x.xx>\bin\”.目录下,自己可以在这个目录下寻找,本人为C:\ProgramFiles (x86)\Microsoft SDKs\Windows\v7.0A\Bin

4、在命令中输入corflags/32bit+ ResGen.exe /force 

5、执行完成之后就可以了,现在打开VS重新建立工程,会发现还是报错

6、接下来需要在所建立的工程中查找<project_name>.csproj文件,用记事本打开,并且在PropertyGroupsection 内容中加入<ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture> 保存之后可以发现程序可以照常编译了。问题解决!!!

总计,这样的方法虽然解决了这个问题,但是每次建立工程的时候都需要编辑<project_name>.csproj这个文件,没有什么好的办法,需要微软后期解决。

原文地址:

In order to work-around this issue you may need to perform. thefollowing steps:

1. Close all instances of Visual Studio.

2. From the Visual Studio Tools subfolder, open an elevated“Visual Studio Command Prompt (2010)” (using “Run as administrator” option).Change directory to "<system_drive>:\Program Files (x86)\MicrosoftSDKs\Windows\v<x.xx>\bin\”.

3. Issue the command :

corflags /32bit+ ResGen.exe /force

4. Open <project_name>.csproj in notepad.

5. Add the following property <ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>under the PropertyGroup section. Save and close the csproj file.

http://support.microsoft.com/kb/2028833

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值