Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code CSC : error CS1617: Invalid option '7.3' for /langversion

I downloaded VS 2017 15.7, .NET Core 2.1.2 and Blazor to try it out. It wasn't working in VS 2017 properly and thought I would try through the dotnet cli and VS Code. Instead I was met with the following error:

CSC : error CS1617: Invalid option '7.3' for /langversion.

In VS, it will run the application show "Loading..." and then nothing. Not sure if the two issues are related

dotnet --info returns the following:

.NET Command Line Tools (2.1.300-preview1-008174)  Product Information:  Version:            2.1.300-preview1-008174 Commit SHA-1 hash:  b8df89a54f  Runtime Environment:  OS Name:     Windows  OS Version:  10.0.17666  OS Platform: Windows  RID:         win10-x64  Base Path:   C:\Program Files\dotnet\sdk\2.1.300-preview1-008174\  Microsoft .NET Core Shared Framework Host    Version  : 2.1.0-preview1-26216-03   Build    : f2c3216183d20416568a4bbf5bb7d153e826f153 
like image 870
Spydernaz Avatar asked May 10 '18 06:05

Spydernaz


2 Answers

Just had this and a Clean, Rebuild fixed the issue for me.

like image 172
Adam Avatar answered Sep 23 '22 07:09

Adam


On VS 2019, I went to project files, changed the target framework to 4.7.2 from 4.6.2, the project build successfully. Then revert back to 4.6.2 and it still builds successfully

like image 31
Amit Sood Avatar answered Sep 20 '22 07:09

Amit Sood