问题
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?
回答1:
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>
回答2:
Almost forgot this question: the answer from Brian works perfectly for me.
And to answer the second part of the question:
It indeed eliminates the need for a cobol compiler on every maschine if you setup different Configurations.
Thanks Brian.
来源:https://stackoverflow.com/questions/1872553/msbuild-conditional-construct-project-reference-file-reference