-1

I have used a conversion tool to bring a project from C# to VB.NET.

The VB.NET compiler now tells me the following error:

"The value "7.3" is not valid for option "langversion".

I have shown all files in my VB.NET project by clicking the "Show all files" button in the project explorer, then I made a text search for both "7.3" and "langversion", but it wouldn't find anything.

Where in my project is this value stored? Perhaps if I see where it originates from, I can more easily find the culprit.

Thank you!

tmighty
  • 10,734
  • 21
  • 104
  • 218
  • It looks like a C# project. It's a compiler option. In a c# project it's stored in the `csproj` file. – Jimi Apr 21 '20 at 19:35
  • Maybe [this SO question](https://stackoverflow.com/questions/46419760/using-c-sharp-7-1-with-msbuild) can be of help. Langversion is defined in the proj file itself, or else this error is related to a NuGet reference to Microsoft.Net.Compilers. – Sean Skelly Apr 21 '20 at 19:37
  • I have used a conversion tool to bring it from C# to VB.NET. I will try to simply remove this entry. – tmighty Apr 21 '20 at 19:47
  • @SeanSkelly Yes, it's in the vbproj file, thank you. Can I simply remove it? – tmighty Apr 21 '20 at 19:57
  • @tmighty Yes, safe to delete, per [documentation](https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/configure-language-version) it defaults to using the highest language supported by the IDE. – Sean Skelly Apr 21 '20 at 20:05

1 Answers1

2

This value is stored inside the .vbproj file, but unfortunately not easily accessible from the IDE's GUI.

<PropertyGroup>
   <LangVersion>7.3</LangVersion>
</PropertyGroup>

Of course, 7.3 isn't a valid VB language version, hence your problem.

This is safe to simply delete if you don't want to specify a VB language version, per documentation, it just uses the highest language available to the IDE.

Sean Skelly
  • 1,229
  • 7
  • 13