Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch failing to build project because feature not available
TheNephalim
#1 Posted : Tuesday, September 8, 2020 3:10:51 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2018(UTC)
Posts: 5
Location: United States of America

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
TheNephalim
#2 Posted : Tuesday, September 8, 2020 3:31:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/10/2018(UTC)
Posts: 5
Location: United States of America

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.
Remco
#3 Posted : Wednesday, September 9, 2020 12:40:09 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,963

Thanks: 929 times
Was thanked: 1255 time(s) in 1168 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.029 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download