未能加载文件或程序集或它的某一个依赖项(针对资源问题,x86文件在x64上编译失败)
2015-06-25 11:33
405 查看
本内容转载自http://bbs.csdn.net/topics/390334265 四楼。
1.右键卸载项目
2.右键选择编辑工程文件,在打开的文件的最后一行</project>之前加以下内容:
<PropertyGroup>
<ForceResGen32Bit Condition="'$(MSBuildToolsVersion)'=='4.0' And '$(PROCESSOR_ARCHITEW6432)'!='' And '$(TargetingClr2Framework)'=='true' And '$(PlatformTarget)'=='x86'">true</ForceResGen32Bit>
</PropertyGroup>
<Target Name="BeforeResGen" Condition="'$(ForceResGen32Bit)' == 'true'">
<PropertyGroup>
<ResGenSdkToolsPath>$(IntermediateOutputPath)ResGenForced32Bit\</ResGenSdkToolsPath>
</PropertyGroup>
<!-- Copy resgen.exe to intermediate working directory for UAC settings -->
<Copy SourceFiles="$(TargetFrameworkSDKToolsDirectory)ResGen.exe"
DestinationFiles="$(ResGenSdkToolsPath)ResGen.exe" />
<!-- corflags.exe resgen.exe /32BIT+ /Force-->
<Exec WorkingDirectory="$(ResGenSdkToolsPath)"
Command=""$(TargetFrameworkSDKToolsDirectory)corflags.exe" ResGen.exe /32BIT+ /Force" />
<!-- GenerateResource Task parameters
Using the non-64bit Tracker.exe and indicate resgen.exe has been forced to x86 -->
<PropertyGroup>
<ResGenTrackerSdkPath>$(SDK40ToolsPath)</ResGenTrackerSdkPath>
<ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>
<CacheTargetFrameworkSDKToolsDirectory>$(TargetFrameworkSDKToolsDirectory)</CacheTargetFrameworkSDKToolsDirectory>
<TargetFrameworkSDKToolsDirectory>$(ResGenSdkToolsPath)</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
</Target>
<Target Name="AfterResGen" Condition="'$(ForceResGen32Bit)' == 'true'">
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory>$(CacheTargetFrameworkSDKToolsDirectory)</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
<RemoveDir Directories="$(ResGenSdkToolsPath)" Condition="Exists('$(ResGenSdkToolsPath)')" />
</Target>
3.右键重新加载项目,问题解决。本机实验通过
1.右键卸载项目
2.右键选择编辑工程文件,在打开的文件的最后一行</project>之前加以下内容:
<PropertyGroup>
<ForceResGen32Bit Condition="'$(MSBuildToolsVersion)'=='4.0' And '$(PROCESSOR_ARCHITEW6432)'!='' And '$(TargetingClr2Framework)'=='true' And '$(PlatformTarget)'=='x86'">true</ForceResGen32Bit>
</PropertyGroup>
<Target Name="BeforeResGen" Condition="'$(ForceResGen32Bit)' == 'true'">
<PropertyGroup>
<ResGenSdkToolsPath>$(IntermediateOutputPath)ResGenForced32Bit\</ResGenSdkToolsPath>
</PropertyGroup>
<!-- Copy resgen.exe to intermediate working directory for UAC settings -->
<Copy SourceFiles="$(TargetFrameworkSDKToolsDirectory)ResGen.exe"
DestinationFiles="$(ResGenSdkToolsPath)ResGen.exe" />
<!-- corflags.exe resgen.exe /32BIT+ /Force-->
<Exec WorkingDirectory="$(ResGenSdkToolsPath)"
Command=""$(TargetFrameworkSDKToolsDirectory)corflags.exe" ResGen.exe /32BIT+ /Force" />
<!-- GenerateResource Task parameters
Using the non-64bit Tracker.exe and indicate resgen.exe has been forced to x86 -->
<PropertyGroup>
<ResGenTrackerSdkPath>$(SDK40ToolsPath)</ResGenTrackerSdkPath>
<ResGenToolArchitecture>Managed32Bit</ResGenToolArchitecture>
<CacheTargetFrameworkSDKToolsDirectory>$(TargetFrameworkSDKToolsDirectory)</CacheTargetFrameworkSDKToolsDirectory>
<TargetFrameworkSDKToolsDirectory>$(ResGenSdkToolsPath)</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
</Target>
<Target Name="AfterResGen" Condition="'$(ForceResGen32Bit)' == 'true'">
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory>$(CacheTargetFrameworkSDKToolsDirectory)</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
<RemoveDir Directories="$(ResGenSdkToolsPath)" Condition="Exists('$(ResGenSdkToolsPath)')" />
</Target>
3.右键重新加载项目,问题解决。本机实验通过
相关文章推荐
- .NET 4 并行(多核)编程系列
- fatal error C1189: #error : Building MFC application with /MD[d]
- Codeforces Round 309 div2
- c语言中static
- SQLite
- java学习之旅14--运算符_02_字符串连接_三元运算符_优先级问题
- .Net学习笔记----2015-06-25(File类的读写文件、List泛型集合、装箱和拆箱、Dictionary字典集合)
- JavaScript中的call()和apply()方法,借此实现继承
- 数据预处理-归一化与z-score标准化
- 并发编程基础概念(一) IO-同步,异步,阻塞,非阻塞(转)
- 3: Android Developer Site镜像网站
- tomcat 服务启动项
- Android事件机制之二:onTouch详解
- HP 4421s 拆机视频
- 获取当前工作目录
- Android中Activity与Task相关的属性解析
- Datasheet,你会读么?[转]
- Rectangle Area——LeetCode
- 15 BasicHashTable基本哈希表类(二)——Live555源码阅读(一)基本组件类
- 使用javascript将时间转换成今天,昨天,前天等格式