I installed the required extensions for vscode using Unity
extension from Microsoft, which automatically installs extensions like C#
and C# Dev Kit
.
I first got an error that says
Failed to load project "c:users...Assembly-CSharp.csproj'
is in unsupported format (for example, a traditional .NET Framework project).
It need be converted to new SDK style to work in C# Dev Kit.
I then converted it by adding the following code on top of the .csproj
files
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>
Then it Worked. But is missing important components such as System.Math.PI
Showing the error 'System.Math'
does not contain a definition for ‘PI’ CS0117`
2
Answers
Solution
The problem was because
Visual Studio Editor
was stuck at version2.0.18
, While it had to be updated to2.0.22
. So, I unlocked and updated it.Steps:
Visual Studio Editor
Unlock
Version history
tab2.0.22
at the time of writingThis solves it And You will find
Visual Studio Code [version]
with the [version] included inEdit >> Preference >> External Tools >> External Script Editor
, where you can choose visual studio code and clickRegenerate project files
More info here
I’ve had issues with
VSCode
andMicrosoft's Unity
extension over the summer and in October (both on Windows and MacOS).These were the specific steps that helped me solve the issue in the past.
If it still isn’t working, try a fresh installation with an empty
Workspace
andUser
settings.json
. By that point something most likely will have fixed your issue.