0

Context. Application WAS 4.5.1 using Microsoft.CodeDOM.Providers.DotNetCompilers. Had to upgrade to 4.6 to use a DLL from a small team that won't change back to 4.5. But now my Razor Views blow up when I try to use "version 6" features like null propagating operators.

if(Model.Object?.Property) {
  //do stuff
}

Already seen this:

C# 6.0 Features Not Working with Visual Studio 2015

Tried building the project with VS2017 and still doesn't work.

Tried setting Project Properties => Build => Advanced => Language Verion to 6 (And 7) and still doesn't work.

Uninstalled CodeDOM.Compiler package, restarted VS, still doesn't work.

FWIW, Version 6 features DO work in .cs source files, this is ONLY affecting Razor views as far as I can tell.

I'm out of ideas. Anyone have a clue?

Community
  • 1
  • 1
BLSully
  • 5,929
  • 1
  • 27
  • 43
  • what is version of .net framework do you use? – Hasan Elsherbiny May 11 '17 at 19:12
  • 2
    Does this related answer help you? http://stackoverflow.com/questions/30832659/string-interpolation-in-a-razor-view – James Orr May 11 '17 at 19:18
  • 1
    Hmmm. Uninstalled CodeDOM. Restarted VS. Cleaned Solution. Reinstalled CodeDOM. Restarted VS. Now it works. *sigh* I have no idea what to put as the answer.... that's just silly. – BLSully May 11 '17 at 19:34

0 Answers0