Trouble using custom constants

Hi,

I'm evaluating Finalbuilder and have got everything working fine except for one small problem.  I need to set a custom compiler directive for a Visual Studio Project.  In the VS IDE, it's set as CLIENT=True.  If I set the same thing in the Compiler Constants field of the Build VS.NET Soltion action, I get the following error:

ERROR BC30037 in vbc(0,0) : Project-level conditional compilation constant 'VBC_VER = 9.0,TARGET = "library",CONFIG="Release",DEBUG=-1,TRACE=-1,_MyType="Windows",PLATFORM="x86",CLIENT=True; ^^  ^^ TRACE' is not valid: Character is not valid.
 

If I take the Compiler Constant it all works fine.  Please tell me what I'm doing wrong!

 

Best regards,
Kenny Munro

Hi Kenny

TRACE is a conditional define… so you just need to have it without a value. If it’s there then it’s value is True, if it’s not it’s value is false.

Hi Vincent,

Thanks for the reply, it half answers my question!

There is still an issue with the TRACE directive though.  When I uncheck the box for TRACE everything works fine and it builds correctly with the compiler custom.  It's the combination of the compiler custom & the trace check box that kills it.  Incidentally, I even  tried leaving TRACE unchecked and adding it manually (i.e. a compiler custom of TRACE;CLIENT=True) but that breaks it too.

Cheers,

Kenny

Ok… this is a STUPID difference the microsoft created between C# and VB. We are just calling MSBuild to build the solution, however the VB compiler expects the defines in a different format from C#. And if you have a solution of mixed VB/C# then you cannot set these defines on the command line.

The work around is to untick TRACE and DEBUG, and add :

TRACE=True;DEBUG=True

Unfortunately C# doesn’t like TRACE=True and will issue a warning and ignore the value.

HTH

Hi Vincent,

Unfortunately that ain’t working either! Still throws exactly the same error - the TRACE=True seems to be getting turned into TRACE=-1 by the time it gets to MSBUILD. Might have to go and figure out another way of setting the compiler constant!

Thanks,
Kenny

I should add (in case it’s relevant)

Machine OS is Windows 2008 Server - Standard Edition
Using SDK V6.0A (no visual studio installed)
Machine is also running FinalBuilder Server

Ok, I think I have it now. On the Action properties tab, Set “Extra MSBuild Properties” to :

DefineTrace=True
DefineDebug=False

Brilliant! That seems to have nailed it, working fine now.

Many thanks Vincent!