Search Issue Tracker

Fixed

Fixed in 2.0.18

Votes

4

Found in [Package]

2.0.11

Issue ID

VS-43

Regression

Yes

Unity VS package generates csproj with the wrong language version

Package: Visual Studio

-

How to reproduce:
1. Open project "Empty Unity Project.zip"
2. Go to Unity>Preferences>External Tools and click the "Regenerate project files" button
3. Open the project folder in your file explorer
4. Open "Assembly-CSharp.csproj" with a text editor but not a VS
5. Look at the "<LangVersion>8.0</LangVersion>" version
6. Close the text editor
7. In the Unity Project window create a new C# Script (Right click>Create>C# Script)
8. Again open "Assembly-CSharp.csproj" with a text editor but not VS
9. Look at the "<LangVersion>latest</LangVersion>" version
10. If the version didn't change go to the 7th step
11. Again go to Unity>Preferences>External Tools and click the "Regenerate project files" button
12. Again open "Assembly-CSharp.csproj" with a text editor but not VS
13. Look at the "<LangVersion>8.0</LangVersion>" version

Expected result: Lang version should be 8.0 (or different in other versions)
Actual result: Lang version is "latest"

Reproducible with: 2.0.11 (2020.1.0a21, 2020.3.20f1, 2021.1.25f1, 2021.2.0b16, 2022.1.0a12)
Not reproducible with: 2.0.11 (2019.4.31f1)
Could not test with: 2020.1.0a20 ("Regenerate project files" button wasn't appearing)

Comments (2)

  1. dsenn

    Mar 02, 2022 15:58

    fixing this should be a minor amount of work and would improve the ux a lot.

  2. stavroskaskuras

    Nov 05, 2021 19:27

    Please fix it as imo get suggestions for things that belong in c# 9 like the new() constructor...
    Also it is very disturbing seeing start and update being continuously underlined because visual studio thinks they are not used....

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.