Hi Graham,
Thanks for posting and I'm glad you like the tool :)
I've done some more digging and I've managed to find a workaround for using DefineConstants on VB.NET projects. Depending upon the number of projects in your solution, there may be some effort involved.
Basically, NCrunch is manipulating the XML in your .vbproj files to add an extra compile constant to the expression where it is present. NCrunch only looks in the .vbproj file, not in any of the project file 'imports', so we should be able to work around the bug by placing your DefineConstants declaration in and imported .targets file.
In the root of your solution, create a file with the following content:
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="(- BROKEN LINK -)">
<PropertyGroup>
<DefineConstants>MyConstant="MyValue"</DefineConstants>
</PropertyGroup>
</Project>
... Adjusting the MyConstant="MyValue" as you need to. You will then need to modify each project file requiring the constant. Remove the <DefineConstants> declaration from the project file, and add an <Import> declaration pointing to the file you created above. For example:
<Import Project="..\NCrunchWorkaround.targets" />
This should allow you to use compiler constants for VB.NET without NCrunch blowing up. I'm keen to hear how well this works for you!
Cheers,
Remco