活动解决方案平台VS项目平台VS平台的目标 [英] Active solution platform VS Project Platform VS Platform target

查看:2850
本文介绍了活动解决方案平台VS项目平台VS平台的目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的应用程序是建立用于基于x64的(因为我使用的x64动态链接库)。 在配置管理器我给自己定活动解决方案平台,64​​ 然而,项目列表平台中设置为86。 在项目属性平台目标也设置为86

I want my application to be build for x64 (because i'm using x64 dlls). In configuration manager I've set "Active solution platform" to "x64" However in the projects list Platform is set to "x86". "Platform target" in project properties is also set to "x86"

我完全糊涂了有三个地方设置目标平台:

I totally confused there are three places to set target platform:

  • 配置管理:有效解决方案平台
  • 配置管理:项目平台
  • 在项目属性:目标平台

例如我可以设置活动解决方案平台到x64,项目平台,x86和项目目标64。会是什么意思?

For example I can set Active solution platform to x64, Project platform to x86 and Project target to x64. What will that mean?

难道有人能够描述究竟各选项的意思是,他们应该如何一起使用?如何编译到x64?

Do someone can describe what exactly each of these options mean and how they supposed to be used together? How to compile to x64?

推荐答案

在活动解决方案平台允许您配置配置为每个项目的特定组合。该项目平台让你做出具体的配置设置的项目。这两个设置实际上并不知道哪些平台解决方案和项目也都将内置任何东西,它只是一个配置集,你可以改变的实际设置。默认情况下,64位设置,设置要专门为64位编译了该项目,但这是多变的,通过该项目平台目标属性项目属性(虽然这将是非常混乱更改目标设定为别的比现有配置的名称)。

The Active Solution Platform allow you to configure a specific combination of configurations for each project. The Project Platform allow you to make specific configuration settings for a project. These two setting doesn't actually tell anything about which platform the solution and projects are going to be built with, it's just a configuration set that you can change the actual settings for. By default the x64 setting sets the project to be compiled specifically for x64, but that's changeable in the project properties via the project Platform Target property (though it would be very confusing to change the target for an existing configuration set to be anything else than its name).

该项目平台目标属性是这是我们用来判断哪些平台项目汇编的编译的设置。值为anycpu的设置的建议,如果你没有在需要特定平台的工作部件的任何依赖关系设置。该值为anycpu设置将导致组件JIT:编到86在32位平台和x64的64位平台。请参见这个问题了解更多信息。

The project Platform target property is the setting that's used to tell which platform the project assembly is compiled for. A setting of AnyCPU is the recommended setting if you don't have any dependencies on components that require a specific platform to work. The AnyCPU setting will cause the assembly to JIT:ed to x86 on 32 bit platforms and x64 on 64 bit platforms. See this question for further information.

至于你的榜样,制定有效的解决方案平台,到x64,项目平台,x86和项目目标64就意味着选择该解决方案配置项目大会将建成以JIT只有64位时,如果导致错误试图在32位平台上运行它。

As for your example, setting Active solution platform to x64, Project platform to x86 and Project target to x64 would mean that when selecting that solution configuration the project assembly would be built to JIT only to 64 bit, causing an error if you tried to run it on a 32 bit platform.

在64位设置应使用,如果你有一个64位的依赖性唯一的资源,比如一个64位的DLL。相应地,86设置应使用,如果你有一个32位的唯一资源的依赖。

The x64 setting should be used if you have a dependency on a 64 bit only resource, such as a 64 bit dll. Correspondingly the x86 setting should be used if you have a dependency on a 32 bit only resource.

配置管理器设置可以用来改变你的项目是由内置例如使用不同的引用程序适用于x86 / x64操作系统,甚至用于调试/释放的方式,像的 Q /六万六千八百四十九分之五百四十九万一千二百五十三>。构成集合被重新psented作为可用于生成配置内来控制,以包括和其构建任务来运行一个特定的配置变量$ P $。看看里面的记事本一个项目文件,你会看到如何使用它。

The configuration manager settings can be used to change the way you projects are built by for example use different referenced assemblies for x86/x64 or even for debug/release, like in this question. The configuration set are represented as variables that can be used inside the build configuration to control what to include and which build tasks to run for a specific configuration. Take a look inside a project file with notepad and you will see how it's used.

这篇关于活动解决方案平台VS项目平台VS平台的目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆