Build/Test Issues

Failing to build: The "NullableContextOptions" parameter is not supported by the "Csc" task

Started by AndersBaumann on 3,358 views

After upgrading to VS 2019 16.4.1 NCrunch cannot build a .Net MVC 4.7.2 project. The project builds without issue in VS. The error message is:

..\packages\Microsoft.Net.Compilers.3.1.1\tools\Microsoft.CSharp.Core.targets (100, 10): The "NullableContextOptions" parameter is not supported by the "Csc" task. Verify the parameter exists on the task, and it is a settable public instance property.
..\packages\Microsoft.Net.Compilers.3.1.1\tools\Microsoft.CSharp.Core.targets (59, 5): The "Csc" task could not be initialized with its input parameters.

Screen shot: https://ibb.co/QFpMg50

Edited

Hi, thanks for sharing this issue.

This looks like a desynchronisation issue between the version of MSBuild being used in your updated version of Visual Studio and the custom version of CSharp being targeted using the Microsoft.Net.Compilers package.

Do you require the use of this package in your code? We have encountered this problem before but couldn't find a way to solve it, as it was caused by incompatibility between the MS components under the hood.
Hi Remco. Thanks for the quick answer. Do you mean the "Microsoft.Net.Compilers.3.1.1" package? I actually don't know if it is required. So you suggest to just remove the reference to this package in the MVC project?

Edited

I removed the package "Microsoft.Net.Compilers" from the MVC project and now NCrunch can build the project. It looks like the MVC project works fine without "Microsoft.Net.Compilers" so problem solved. Thanks for your help.

Post a reply

Log in to reply.