vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Update to 1.25.0. I can't use F12,and check reference in Unity C# project.

Open Liweitalent opened this issue 2 years ago • 6 comments

Environment data

dotnet --info output: VS Code version: 1.67.2 C# Extension version:1.25.0

OmniSharp log

Steps to reproduce

  1. Open Unity C# project
  2. Use F12 can't go to defence.
  3. can't check reference property
  4. back to C#1.24.4 ,That errors is disappear

Expected behavior

A clear and concise description of what you expected to happen.

Actual behavior

Additional context

I worked normal yesterday. But Today , It is working error ,and i check edior update c# extension in 2022/5/25. So I back up to 1.24.4 .It can work

Liweitalent avatar May 26 '22 01:05 Liweitalent

Had the same problem, this posted helped. https://github.com/OmniSharp/omnisharp-vscode/issues/5120#issuecomment-1092000572

After you change the setting, you'll probably have to restart VS Code and then the dependency will install for you, then it should work normally again.

Mister-Nebbers avatar May 26 '22 02:05 Mister-Nebbers

Had the same problem, this posted helped. #5120 (comment)

After you change the setting, you'll probably have to restart VS Code and then the dependency will install for you, then it should work normally again.

I tried that and it didn't fix the issue for me. Looks like OmniSharp is looking for DOT_NET_ROOT. Downgrading back to 1.24.4 works for me. I'm not going to expect this extension to fix the issue considering Unity has fallen so far behind the C# eco system.

Starting OmniSharp on Windows 6.2.9200.0 (x64) info: OmniSharp.Services.DotNetCliService Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK info: OmniSharp.Services.DotNetCliService Using the 'dotnet' on the PATH. info: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 0 MSBuild instance(s)

AlejandroHuerta avatar May 27 '22 01:05 AlejandroHuerta

@AlejandroHuerta If you are doing Full Framework development on Windows (omnisharp.useModernNet: false) then you will need to install the Visual Studio MSBuild Tools.

JoeRobich avatar May 27 '22 17:05 JoeRobich

Quick Solution for every platform (Windows, Linux, Mac)

  • Set VS Code update mode to 'manual'
  • Disable Windows Background Updates
  • Downgrade the VS Code version to February 2022 (version 1.65)
  • Downgrade the C# extension version to v1.24.4

everything will be fine 💯

Mubeyd avatar Jun 01 '22 09:06 Mubeyd

Quick Solution for every platform (Windows, Linux, Mac)

  • Set VS Code update mode to 'manual'
  • Disable Windows Background Updates
  • Downgrade the VS Code version to February 2022 (version 1.65)
  • Downgrade the C# extension version to v1.24.4

everything will be fine 💯 Closed / resolved /updated / .NET 5 / .NET 6 https://github.com/OmniSharp/omnisharp-vscode/issues/5253#issuecomment-1150528966

Mubeyd avatar Jun 10 '22 11:06 Mubeyd

@AlejandroHuerta If you are doing Full Framework development on Windows (omnisharp.useModernNet: false) then you will need to install the Visual Studio MSBuild Tools.

That fixed it for me. Thank you.

AlejandroHuerta avatar Jun 14 '22 02:06 AlejandroHuerta