Visual Studio 2010 条件引用
我们这里有多个产品共享一些公共库。这些库是单独解决方案的一部分(因此它们可以由TFS独立构建),但问题是在开发过程中,必须修改公共库,将其编译为二进制文件,将其复制到公共位置,编译产品解决方案。
为了避免这种情况,我想知道是否可以有条件引用,因此对于调试配置,我将它们作为项目引用引用,而在发布配置中它们将是二进制引用。
We have multiple products here that shared some common libraries. These libraries are part of a separate solution (so they can be built by TFS independently), but the problem is during development, one has to modify the common library, compile it to binary, copy it to the common location, compile the product solution.
In order to avoid this actually I am wondering if its possible to have conditional references, so for a debug configuration, I would reference them as project references, while in release configuration they would be binary references.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够通过直接编辑项目文件来使用条件构造来执行此操作(VS IDE 不会为您执行此操作)。
例如,您可以使用“Choose”元素执行类似的操作:
MSDN 有 更多有关使用条件构造的信息。
You should be able to do this with conditional constructs by editing the project file directly (VS IDE won't do this for you).
For example, you might do something like this using the "Choose" element:
MSDN has more information about using conditional constructs.
您可能想看看 NuGet:
(在这种情况下,您自己就是第三方)
注意:这不会为您提供条件引用,但可以轻松更新公共组件。
You might want to have a look at NuGet:
(where you would be the third party yourself in this case)
Note: This would not give you conditional references, but it would ease updating the common components.