3

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?

Doc Snuggles
  • 241
  • 1
  • 3
  • 15

2 Answers2

5

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>
Brian
  • 117,631
  • 17
  • 236
  • 300
  • At least a part of the question answered. Guess I have to try the rest by myself. Thanks anyway! – Doc Snuggles Dec 14 '09 at 10:19
  • Coming late to the party, but I find myself doing something similar, and from a straight MSBuild perspective, this works great. Compiles correctly based on the build-configuration. However, I've experienced some weirdness in VS2010 - for example, the references in project explorer always look like the assembly-references. Also, Build-Order isn't figured out automatically. I'm assuming that's because of VS seeming to think, even if conditionals stipulate ProjectReference, it's an assembly Reference. – Yoopergeek Dec 29 '10 at 13:46
  • @Yoopergeek - I'm experiencing the Assembly vs Project Reference, too. Were you able to resolve it? http://stackoverflow.com/questions/10738246/buildinginsidevisualstudio-property-value-not-working-with-file-reference-and-pr – kevindaub May 29 '12 at 13:18
0

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.

Doc Snuggles
  • 241
  • 1
  • 3
  • 15