Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OmniSharp server throws System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, When Opening Unity Project

I've updated my Visual Studio Code this morning, after doing update it restarted it self. I did not get any options(i.e. "Goto Definition", "Rename Symbol")when I right click on any variable, method, class name. After searching for a while I found that Opening View > Output might help me to know what's going on. and I found Omniserver is not running and below is the error which I got in Output window.

Starting OmniSharp server at 4/17/2019, 2:42:04 PM
    Target: d:\projects\Division\Division.sln

OmniSharp server started.
    Path: C:\Users\Unity3\.vscode\extensions\ms-vscode.csharp-1.19.0\.omnisharp\1.32.18\OmniSharp.exe
    PID: 7508

System.IO.FileNotFoundException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
   at OmniSharp.Stdio.Driver.Program.<>c__DisplayClass0_1.<Main>b__1()
   at OmniSharp.HostHelpers.Start(Func`1 action)

=== Pre-bind state information ===
LOG: DisplayName = netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
 (Fully-specified)
LOG: Appbase = file:///C:/Users/Unity3/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Extensions.Logging.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Unity3\.vscode\extensions\ms-vscode.csharp-1.19.0\.omnisharp\1.32.18\OmniSharp.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
LOG: Attempting download of new URL file:///C:/Users/Unity3/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/netstandard.DLL.
LOG: Attempting download of new URL file:///C:/Users/Unity3/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/netstandard/netstandard.DLL.
LOG: Attempting download of new URL file:///C:/Users/Unity3/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/netstandard.EXE.
LOG: Attempting download of new URL file:///C:/Users/Unity3/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/netstandard/netstandard.EXE.

[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).

like image 239
Ghost The Punisher Avatar asked Mar 05 '23 03:03

Ghost The Punisher


2 Answers

I had the same problem with Omnisharp v1.19.0 after updating VSCode. I ended up resolving it by rolling back the C# extension to an earlier version that worked for me (1.18.0). Right click the extension and select Install Another Version... Hope this helps!

like image 57
luckyjc Avatar answered Mar 09 '23 05:03

luckyjc


The rollback to 1.18.0 worked for me, but be sure to set the preference "extensions.autoUpdate" to false or it will just reinstall 1.19.0

like image 42
user6933613 Avatar answered Mar 09 '23 07:03

user6933613