VS 的编译选项 build下的platform -- Any CPU和x86有什么影响?

现在的问题是,我的一个assembly用Any CPU编译就不能在64位系统下运行了,但是用x86编译就ok

原因是如果用Any CPU编译,那么在64位机器默认的运行就是64位的,

而我的assembly需要调用一个32的COM库,所以就运行不起来

只要用x86编译,那么程序就是以32位的程序,依靠wow64来运行的,所以就ok

所以,如果assembly需要使用win32库的话,

那么编译选项就不能使用默认的Any CPU了需要注意
 
我去,ANY CPU的意思不是任何CPU都可以用,而是当前编译的这台机子的环境可用
 
 
大家可再了解一下
Mixed Platform vs Any CPU
 
 Team Build deals with solution configurations - these are the platforms (e.g. .NET or Win32) and configurations (e.g. Debug or Release) you typically see in combo boxes within Visual Studio when you have a solution loaded (if you hover over these boxes the tooltips will say "Solution Platforms" and "Solution Configurations", respectively).  When all of the projects in a solution are of the same type (e.g. C#/VB projects) the solution configurations will match up exactly with the project configurations.  Once you have projects in a solution that have mismatched configurations/platforms, Visual Studio creates the solution level configuration(s) "Mixed Platforms/Debug" and possibly "Mixed Platforms/Release".  These configurations are just mappings to individual project level configurations.

For example, if you have a C# project and a C++ project, typically "Mixed Platforms/Debug" will map to "Any CPU/Debug" for the C# project and "Win32/Debug" for the C++ project.

To see these mappings, open up the Configuration Manager (either through the Build menu or by clicking on the platform or configuration combo box and selecting Configuration Manager...).  You should see combo boxes for the Active solution configuration and the Active solution platform and then a table showing you the project level mappings.  This will show you the platform generated for each project under each solution configuration.

 

VS 的编译选项 build下的 platform target -- Any CPU和x86有什么影响?的更多相关文章

  1. 交叉编译中的build、host和target

    build.host和target    在交叉编译中比较常见的一些参数就是build.host和target了,正确的理解这三者的含义对于交叉编译是非常重要的,下面就此进行解释 --build=编译 ...

  2. 编程杂谈——Platform target x64

    在Visual Studio中选择.NET Framework框架并选用任意模板创建一个普通的Web应用工程,毫无疑问,此时应该是能够正常运行此工程的. 但是将工程属性->编译->Plat ...

  3. 交叉编译参数--build、host和target的区别

    build.host和target 在交叉编译中比较 常见 的一些参数就是build.host和target了,正确的理解这三者的含义对于交叉编译是非常重要的,下面就此进行解释 --build=编译该 ...

  4. Warning: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info

    WARNING: The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'. ...

  5. HikariCP 脑火Failed to obtain JDBC Connection: You need to run the CLI build and you need target/classes in your classpath to run.

    测试了一下 HikariCP 连接池报错,无解 十一月 16, 2017 5:31:59 下午 org.apache.catalina.core.StandardContext loadOnStart ...

  6. Linux下OpenSSL的安装全过程(CentOS6.3 x86 + Openssl 1.1.0e)

    写在前面:安装前先查看下老的openssl版本 (使用  openssl version -a  命令查看来版本),和服务器操作系统版本(uname   -a),升级的原因是,老版的openssl已经 ...

  7. 02全志r58平台Android4.4.4下关闭内核中的CPU的开启关闭提示

    02全志r58平台Android4.4.4下关闭内核中的CPU的开启关闭提示 2017/8/18 13:53 版本:V1.0 开发板:SC5806(全志R58平台) SDK:android4.4.4 ...

  8. linux下查看动态链接库依赖关系的命令 x86: ldd *.so arm: arm-linux-readelf -d *.so 实际例子: 以项目中用到的库librtsp.so分析: lijun@ubuntu:~/workspace$ arm-hisiv100nptl-linux-ld -d librtsp.so arm-hisiv100nptl-linux-ld:

    linux下查看动态链接库依赖关系的命令 x86:ldd    *.so arm:arm-linux-readelf    -d    *.so 实际例子:以项目中用到的库librtsp.so分析:l ...

  9. STM32F103C8T6 在VSCode下使用Platform IO开发,基于库函数V3.5版本

    首先安装Platform IO插件,怎么安装的教程有很多,可以自行百度,就不在重复了. 本篇文章将会以正点原子的跑马灯例程作为移植对象,基于ST固件库3.5版本 将实现在VSCode上的程序编写与烧录 ...

随机推荐

  1. ae动态显示属性表————切记DataTable中要先Add(row)之后再往里传值。

    public partial class FrmAttributeTable : Form { private AxMapControl m_MapCtl; public FrmAttributeTa ...

  2. VPN常见错误码(633,628,691)的意思及修复方法

    因为工作原因经常上国外网站需要用到VPN,在这里总结一下使用中可能遇到的一些常见问题.(目前用Nydus觉得还不错) 1.633错误 :由于Windows系统本身的问题,在PPTP协议连接多次并断开之 ...

  3. CalloutManager

    在SharePoint中很多弹出的提示样式挺好看,不仅想整一个耍耍.如下图: 老办法,看一下html中的class名字得知为:Callout 谷歌之---官方文档:http://msdn.micros ...

  4. 操作系统开发系列—12.b.从Loader跳入保护模式

    现在,内核已经被我们加载进内存了,该是跳入保护模式的时候了. 首先是GDT以及对应的选择子,我们只定义三个描述符,分别是一个0~4GB的可执行段.一个0~4GB的可读写段和一个指向显存开始地址的段: ...

  5. 打印frame

    NSLog(@"%@",NSStringFromCGRect(switch.frame)); 或者 CFShow(NSStringFromCGRect(switch.frame)) ...

  6. iOS-RunTime

    原帖:http://www.cnblogs.com/Mike-zh/p/4557014.html 1.Runtime简介 因为Objc是一门动态语言,所以它总是想办法把一些决定工作从编译连接推迟到运行 ...

  7. javascript中,如何判断input中输入的为纯数字

    用正则表达式判断.如果纯数字是指整数的话(不包含小数点),可以这样: function check(){ var value = document.getElementById("input ...

  8. HashMap常用方法

    当需要对元素进行计数时,HashMap非常有用,如下例子,统计一个字符串中每个字符出现的次数: package simplejava; import java.util.HashMap; import ...

  9. PreferenceScreen监听子项的刷新

    有个PreferenceScreen,他有一些个子项目.它的Summary需要根据子项的设置来改变的,所以需要监听子项的刷新事件. preferenceScreen.setOnPreferenceCh ...

  10. .htaccess绑定网站主目录的方法

    用过cpanel的基本都会知道要把自己的服务器脚本传到public_htmk这个文件夹下,这个就是整个网站的主目录,普通的Apache服务器可以用下面的代码来实现这种效果 RewriteEngine ...