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. Javascript 面向对象编程初探(一)--- 封装

    Javascript是一种基于对象(object-based)的语言,你遇到的所有东西几乎都是对象.但是,它又不是一种真正的面向对象编程(OOP)语言,因为它的语法中没有class(类). 那么,如果 ...

  2. 微信不支持Object.assign

    微信不支持Object.assign,让我Vue怎么用QAQ... 解决方法: https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Refe ...

  3. 在Kali Linux下安装与配置OpenVas

    以下是我的Kali版本号: 执行安装命令: apt-get install openvas 安装完成后可以在漏洞分析菜单下查看到OpenVas相关选项. 以下为安装完成后需要用到的几个命令: open ...

  4. DevExpress 2015.2发布 看看有哪些更新

    下面是besy翻译的部分重要更新,要查看全部更新细节请访问英文官网. | 下载DevExpress 2015.2 Diagram Control 新的DevExpress Diagram Contro ...

  5. jsom sharepoint 2010 循环获取多个list的item值

    <script type="text/javascript"> // <![CDATA[ var chongdianbaId; var elm = documen ...

  6. 在Android Stuido中使用Lint

    要运行Lint工具,大家首先需要在Android Studio的“Analyze”菜单中选择“Inspect Code…”.当Android Studio完成了对项目的检测之后,它会在窗口底部显示出分 ...

  7. Java Android HTTP实现总结

    Java Android HTTP实现总结 Http(Hypertext Transfer Protocol)超文本传输协议,是一个基于请求/响应模式的无状态的协议,Http1.1版给出了持续连接的机 ...

  8. 关于iOS中的时间

    两类 绝对时间 [NSDate date].CFAbsoluteTimeGetCurrent(),或者gettimeofday(). 返回的是从某一个时刻开始,度过的秒数.会随着用户设置的系统时间更改 ...

  9. 2016京东Android研发校招笔试题

    一.选择题汇总,具体的记不住啦.. 1.计网:ip的网络前缀.SNMP(报文组成):http://blog.csdn.net/shanzhizi/article/details/11606767 参考 ...

  10. 【代码笔记】iOS-截屏功能

    代码: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // ...