0

I have a solution in which I've removed the CodeDom package (aka roslyn). I have a reason for doing this which is related to another question. However, after doing it I now get the error message Feature 'null propagating operator' is not available in C# 5. Please use language version 6 or greater. in a handful of places with C# 6.0+ features in use. I don't want to change the code for this whole web application and hunt down the hundreds of potential uses of this. How can I enable these features? Is this something where I just have to have codedom included in my solution? I tried setting the advanced features of the build in both the project properties and by editing the project file directly, but neither thing seems to have worked.

Documentation from microsoft suggests that the .NET Framework in Visual Studio 2019 should be operating on C# 7.3 regardless of anything else I have going on at this point.

Matt
  • 1,202
  • 14
  • 38
  • I did some tests, since you have tried modifying the `.xxproj` file and setting the `Language version`, but the issue persists, I think the most possible solution should be have CodeDom package installed(I knew that you have to remove the CodeDom). Perhaps, you can try delete the hidden `.vs` file in your solution and delete(make a backup if necessary) the VS cache(folder named `ComponentModelCache` under C:\Users\[user name]\AppData\Local\Microsoft\VisualStudio\16.0_XXXXX), then restart VS and rebuild the solution to see if this works. – Jack J Jun - MSFT Jun 09 '21 at 08:35

0 Answers0