由于x86/x64设置,如何引用不同的组装路径? [英] How to refer to different assembly path due to x86/x64 setting?

查看:103
本文介绍了由于x86/x64设置,如何引用不同的组装路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C ++/CLI程序集参考中,我有x86和x64 dll被参考.根据我的解决方案平台和配置更改,我想使用正确的路径引用相应的程序集.例如,如果解决方案平台是x86,并且配置是debug, 我希望看到程序集引用路径,例如".. \ .. \ x86 \ debug \ my.dll";如果平台更改为x64并且发布了配置,则我希望程序集引用路径更改为".. \ .. \ x64 \ release \ my.dll".所以我可以有一个正确的编译和链接 正确组装.我引用的程序集是具有x86/x64版本的c ++/cli dll.谢谢!


JH

In C++/CLI assembly reference I have x86 and x64 dll to be refered. Based on my solution platform and configuration change, I want to refer to corresponding assembly with right path. For example, if solution platform is x86 and configuration is debug, I expect to see assembly reference path like "..\..\x86\debug\my.dll"; If platform is changed to x64 and configuration is release, I expect my assembly reference path is changed to "..\..\x64\release\my.dll". So I can have a correct compilation and link to right assembly. My refered assembly is a c++/cli dll which has x86/x64 version. Thanks!


JH

推荐答案

dll搜索路径可以由

The dll search path can be controlled by the DLL activation context. You can use mt.exe to embed a different assembly manifest in a post-build setup for each configuration. 

请注意,这只会影响依赖于搜索的相对路径的LoadLibrary,不会以绝对路径加载dll.

Note this only affects LoadLibrary with a relative path which depends on searching, loading dll with an absolute path won't be affected.


这篇关于由于x86/x64设置,如何引用不同的组装路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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