且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为 x86 和 x64 平台构建项目目标

更新时间:2022-12-02 12:30:37

最后,我在 Visual Studio 中使用 Shared Project 解决了这个问题.我想要的是通过构建解决方案将生成两个 Excel Addin 程序集,一个针对 x86 平台或 AnyCPU,另一个针对 x64代码>平台.

Finally, I have solved this problem by using Shared Project in Visual Studio. What I want is two Excel Addin assemblies will be generated by building the solution, one is targeting to x86 platform or AnyCPU, the other is targeting to x64 platform.

这是我的项目快照:

所有的代码文件(*.cs)和资源(图片或xml文件)都被移到了Shared项目中,另外两个项目都引用了它.

All the code files(*.cs) and resources(images or xml files) are moved into the Shared project, and both the other 2 projects have a reference to it.

至于其他两个项目,它们之间存在一些差异,例如程序集名称和目标平台.一个是XXX.dll,针对AnyCPU,另一个是XXX_64.dll,针对x64.

As to the other 2 projects, there are some differences between them, e.g. Assembly Name and Target Platform. One is XXX.dll and targeting AnyCPU, the other is XXX_64.dll and targeting x64.

在构建解决方案时,2个项目中的每一个都会发布相应的程序集.

When building the solution, each of the 2 projects will issue the corresponding assembly.