Build/Test Issues

NCrunch failing to build project because feature not available

Started by TheNephalim on 1,808 views

Hello,

I'm having an issue with testing/building a project in NCrunch.

I'm using Visual Studio 2017 with all updates applied. I'm also using NCrunch Version 4.4.0.12.

The message I'm receiving in NCrunch is the following:

Feature 'default literal; is not available in C# 7.0. Please use language version 7.1 or greater.

I have the language version set in each project to C# Latest Minor Version. I actually set the language version explicitly to version 7.3 in the project with which I am having issues.

I set the build output to verbose and confirmed the switch is set to /langversion:7.3 for the compiler.

My understanding from reviewing another post in the forums is that NCrunch basically sits on top of the build system and basically uses whatever configuration the build system uses.

I'm not really sure where to go from here.

Any assistance is appreciated.

Sincerely,
Robert Eberhart

Edited

Ok. I took a look at the Custom Build Properties for the project in NCrunch and explicitly added langVersion with 7.3 as the value. As soon as I did that, the project compiled and the unit tests all ran. I'm not sure why it's not finding the configuration values set by the project, though.

I also change the value from 7.3 to latest and this also worked.

Edited

Thanks for letting us know how you fixed this. My best guess here is that the compiler language version is being set conditional to a targeted build configuration inside the .proj file. NCrunch will always use the default build configuration specified in the file (unless configured otherwise), while VS will always use the one selected in the UI at the top of the IDE ... this is a point of difference that can sometimes cause unexpected behaviour. Check your .proj files to be sure whether the langversion is specified in the right place inside the file.

Post a reply

Log in to reply.