C#/ VS2008:添加单独的调试/释放引用到项目 [英] C# / VS2008: Add separate debug / release references to a project

查看:447
本文介绍了C#/ VS2008:添加单独的调试/释放引用到项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在添加用户控件或一个项目引用到VS 2008 C#项目,我可以只添加一个组件的配置。是否有可能增加单独的配置,根据容器项目的配置。

When adding a user control or a project reference to a VS 2008 C# project, I can add only one configuration of the assembly. Is it possible to add separate configurations, depending on the configuration of the container project.

例如。我正在开发一个用户控件,而我工作的一个示例应用程序。我想要添加的用户控制,以使样本的调试版本将使用用户控件的调试版本,样本用户控件的发布版本的发布版本。

E.g. I am developing a user control, and I am working on a sample application. I want to add the user control so that a debug build of the sample will use the debug build of the user control, and the release build of the sample the release build of the user control.

任何建议

推荐答案

您可以通过编辑的csproj文件做到这一点;添加一个条件属性的参考。

You can do this by editing the csproj file; add a "Condition" attribute to the reference.

<Reference Include="Foo" Condition="'$(Configuration)'=='Debug'"/>
<Reference Include="Bar" Condition="'$(Configuration)'=='Release'"/>



不过,我想有这意味着什么单元测试的担忧。

However, I would have concerns about what this means for unit testing.

这篇关于C#/ VS2008:添加单独的调试/释放引用到项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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