MSBuild:条件构造(项目参考|文件参考) [英] MSBuild: Conditional Construct (Project Reference | File Reference)

查看:202
本文介绍了MSBuild:条件构造(项目参考|文件参考)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我可能会创建以下构建行为:



如果配置是调试,那么在ExCobol.cblproj
上使用ProjectReferences如果配置是DebugVB,那么在ExCobol.dll上使用FileReferences



当是的时候,如何实现呢?



我假设在项目文件中使用标签将
做到。



这是真的消除了需要一个cobol编译器的
DebugVB配置?

解决方案

,假设您有

 < ProjectReference ...> ...< / ProjectReference> 

 < Reference ...> ...< / Reference> 

您要手动编辑.proj文件以包含

 < ProjectReference Condition ='$(Configuration)'!='DebugVB'...> ...< / ProjectReference> 
< Reference Condition ='$(Configuration)'=='DebugVB'...> ...< / Reference>


I´m still trying to eleminate the need of a cobol compiler in a Project with cobol-Projects in it.

Is it possible to create following build behaviour:

If the Configuration is Debug then use ProjectReferences on ExCobol.cblproj if the Configuration is DebugVB then use FileReferences on ExCobol.dll

When Yes, How to achieve it?

I assume the use of tags in the project file will do the trick.

And does this really eliminate the need of a cobol compiler for the DebugVB Configuration?

解决方案

Regarding the conditional 'how', assuming you have either

<ProjectReference ...>...</ProjectReference>

or

<Reference ...>...</Reference>

you want to hand-edit the .proj file to include both thusly

<ProjectReference Condition="'$(Configuration)'!='DebugVB'" ...>...</ProjectReference>
<Reference Condition="'$(Configuration)'=='DebugVB'" ...>...</Reference>

这篇关于MSBuild:条件构造(项目参考|文件参考)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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