0

I have just updated my Visual Studio from Visual Studio Professional 2017 to Visual Studio Enterprise 2017. Immediately I got these errors for compilation of my ASP.NET Web Application.

Invalid option '7.2' for /langversion; must be ISO-1, ISO-2, Default or an integer in range 1 to 6. For the file CSC

The solutions on the internet told me to change the Language version to C# 7.0 from default and to reinstall Microsoft.CodeDom.Providers.DotNetCompilerPlatform. Changing to C# 7.0 did not work and I don't have this dll.

In fact I don't have a section in my web.config file so I can not change the language here or the type or anything.

I am not sure why I am getting this error. Does anyone have any ideas? Why don't I have a section?

Darren
  • 1,352
  • 5
  • 19
  • 49
  • 2
    Possible duplicate of [Using C# 7.1 with MSBuild](https://stackoverflow.com/questions/46419760/using-c-sharp-7-1-with-msbuild) – Jonathon Chase Sep 13 '18 at 01:00

1 Answers1

0

I was very silly!

After I downloaded the new Enterprise Visual Studio 2017 I did not do any updates and so the default version (which selects the highest) was only c# 7.0. My project was for c# 7.2. So I updated Visual Studio 2017 Enterprise and now I had up to version C# 7.3. And my application compiles now.

Darren
  • 1,352
  • 5
  • 19
  • 49