如何引用考虑到配置和平台的dll

发布于 2024-12-29 15:15:11 字数 601 浏览 2 评论 0原文

我们正在为 MonoTouch 开发一个库,我们可以在所有其他 MonoTouch 项目中使用。为此,我们生成了 4 个 dll,它们取决于配置和平台(调试/发布/iPhone/iPhoneSimulator)。

然后,我尝试将这些 dll 包含在其他 MonoTouch 项目中。在 Microsoft Visual Studio 2008 中,技巧是添加其中一个 dll 作为项目的引用,然后手动编辑项目文件。

例如,对于一个 Dll,我们将更改引用该 Dll 的行:

<Reference Include="Blabla" ...>
  ...
<HintPath>..\$(Platform)\$(Configuration)\Blabla.dll</HintPath>
</Reference>

变量 $(Platform) 和 $(Configuration) 确保我们采用与正确配置和平台相对应的 Dll。

我对 MonoDevelop 项目做了同样的事情,但是当我重新加载修改后的项目时,引用的 Dll 呈红色(找不到文件)。有人知道为什么吗?我在项目/解决方案的配置中遗漏了某些内容吗?这样做的正确方法吗?

We are developing a library for MonoTouch, we could use in all other MonoTouch projects. For that purpose, we have generated 4 dlls that are depending on the configuration and the platform ( Debug / Release / iPhone / iPhoneSimulator).

Then, I am trying to include those dlls in an other MonoTouch project. In Microsoft Visual Studio 2008, the trick is to add one of the dll as reference of the project and then edit manually the project file.

E.g. for one Dll, we'll change the line that reference the Dll:

<Reference Include="Blabla" ...>
  ...
<HintPath>..\$(Platform)\$(Configuration)\Blabla.dll</HintPath>
</Reference>

The variable $(Platform) and $(Configuration) ensures we are taking the Dll corresponding the the right configuration and platform.

I did the same thing with a MonoDevelop project, but when I reload the modified project, the referenced Dll is in red (file not found). Somebody know why? Am I missing something in the configuration of the project / solution? Is the right way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文