如何引用考虑到配置和平台的dll
我们正在为 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论