I am using ncrunch on a .net core project and use "#if !NCRUNCH" in the code but the code is still being run. I am using ncrunch version 3.7.0.7.
Build/Test Issues
Compiler constant being ignored in .net core project
Started by cbondeson on 6,293 views
Remco NCrunch Developer
#10617
15 Jun 2017 12:02 UTC
Hi, thanks for sharing this problem.
I can reproduce this in v3.9 also. It looks like the mechanism for introducing this constant is somehow failing under a CPS build system.
I've noted this down to be fixed.
To work around this, I suggest changing your project file to introduce a build condition around a manually declared build constant, for example:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants Condition="'$(NCrunch)' == '1'">TRACE;DEBUG;NETCOREAPP1_1;NCRUNCH</DefineConstants>
</PropertyGroup>
I can reproduce this in v3.9 also. It looks like the mechanism for introducing this constant is somehow failing under a CPS build system.
I've noted this down to be fixed.
To work around this, I suggest changing your project file to introduce a build condition around a manually declared build constant, for example:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants Condition="'$(NCrunch)' == '1'">TRACE;DEBUG;NETCOREAPP1_1;NCRUNCH</DefineConstants>
</PropertyGroup>
The work around seemed to work, thank you. Please let me know when this is fixed.
Remco NCrunch Developer
#10629
16 Jun 2017 04:04 UTC
The build below includes a fix for this problem:
http://downloads.ncrunch.net/NCrunch_Console_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_Console_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2008_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2012_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2012_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2013_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2013_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2015_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2015_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2017_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2017_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_Console_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_Console_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_GridNodeServer_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_LicenseServer_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2008_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2010_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2012_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2012_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2013_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2013_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2015_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2015_3.10.0.1.zip
http://downloads.ncrunch.net/NCrunch_VS2017_3.10.0.1.msi
http://downloads.ncrunch.net/NCrunch_VS2017_3.10.0.1.zip
Looks like the new build worked with this error. Thanks.
Post a reply
Log in to reply.