Open JonahFairweather opened 2 years ago
I too am having similar issues with omnisharp, vsc (both insiders and regular) and unity. I have both 5.0.400 and 6.0.101 installed
you need to mess a bit with Custom Analyzers to make it work fully, you need to download the nupkg file of Microsoft.Unity.Analyzers, open it with 7zip or winrar as a zip, and navigate to -> analyzers/dotnet/cs/
and add to Omnisharp as a custom analyzer the Dll that is in there. This should fix the problem, it did for me
Environment data
dotnet --info
output: .NET SDK (reflecting any global.json): Version: 6.0.101 Commit: ef49f6213aRuntime Environment: OS Name: Windows OS Version: 10.0.18363 OS Platform: Windows RID: win10-x64 Base Path: D:\Program Files\dotnet\sdk\6.0.101\
Host (useful for support): Version: 6.0.1 Commit: 3a25a7f1cc
.NET SDKs installed: 6.0.101 [D:\Program Files\dotnet\sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 6.0.1 [D:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.1 [D:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.1 [D:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download VS Code version:1.63 C# Extension version: 1.23.17
OmniSharp log
Starting OmniSharp server at 1/2/2022, 2:21:49 AM Target: d:\Users\admin\Snowboarder
OmniSharp server started. Path: c:\Users\admin.vscode\extensions\ms-dotnettools.csharp-1.23.17.omnisharp\1.37.17\OmniSharp.exe PID: 3680
d:\Users\admin\Snowboarder\Assembly-CSharp.csproj D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(1217,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
Received response for /quickinfo but could not find request. Received response for /quickinfo but could not find request.
Received response for /v2/blockstructure but could not find request. Received response for /v2/getcodeactions but could not find request. Received response for /v2/blockstructure but could not find request. Received response for /quickinfo but could not find request. Received response for /v2/getcodeactions but could not find request.
Received response for /v2/blockstructure but could not find request.
Received response for /v2/getcodeactions but could not find request.
{ "Type": "request", "Seq": 2437, "Command": "/filesChanged", "Arguments": [ { "FileName": "d:\Users\admin\Snowboarder\Assets\Scripts\PlayerController.cs", "changeType": "Change" } ] }
{ "Request_seq": 2437, "Command": "/filesChanged", "Running": true, "Success": false, "Message": "\"System.IO.IOException: The process cannot access the file 'd:\\Users\\admin\\Snowboarder\\Assets\\Scripts\\PlayerController.cs' because it is being used by another process.\r\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\r\n at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)\r\n at OmniSharp.Roslyn.BufferManager.d__8.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\BufferManager.cs:line 47\"",
"Body": null,
"Seq": 27889,
"Type": "response"
}
Received response for /quickinfo but could not find request.
Received response for /v2/blockstructure but could not find request.
Received response for /completion/resolve but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/codestructure but could not find request. Received response for /v2/codestructure but could not find request. Received response for /v2/blockstructure but could not find request. Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request. Received response for /v2/blockstructure but could not find request.
Received response for /quickinfo but could not find request. Received response for /v2/blockstructure but could not find request.
{ "Type": "request", "Seq": 6693, "Command": "/filesChanged", "Arguments": [ { "FileName": "d:\Users\admin\Snowboarder\Assets\Scripts\FinishLine.cs", "changeType": "Change" } ] }
{ "Request_seq": 6693, "Command": "/filesChanged", "Running": true, "Success": false, "Message": "\"System.IO.IOException: The process cannot access the file 'd:\\Users\\admin\\Snowboarder\\Assets\\Scripts\\FinishLine.cs' because it is being used by another process.\r\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\r\n at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)\r\n at OmniSharp.Roslyn.BufferManager.d__8.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\BufferManager.cs:line 47\"",
"Body": null,
"Seq": 75982,
"Type": "response"
}
Received response for /completion/resolve but could not find request.
Received response for /completion/resolve but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/blockstructure but could not find request.
Received response for /completion/resolve but could not find request. Received response for /completion/resolve but could not find request.
Received response for /v2/getcodeactions but could not find request. Received response for /completion/resolve but could not find request.
{ "Type": "request", "Seq": 7947, "Command": "/filesChanged", "Arguments": [ { "FileName": "d:\Users\admin\Snowboarder\Assets\Scripts\PlayerController.cs", "changeType": "Change" } ] }
{ "Request_seq": 7947, "Command": "/filesChanged", "Running": true, "Success": false, "Message": "\"System.IO.IOException: The process cannot access the file 'd:\\Users\\admin\\Snowboarder\\Assets\\Scripts\\PlayerController.cs' because it is being used by another process.\r\n at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)\r\n at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)\r\n at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)\r\n at System.IO.File.InternalReadAllText(String path, Encoding encoding, Boolean checkHost)\r\n at OmniSharp.Roslyn.BufferManager.d__8.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\BufferManager.cs:line 47\"",
"Body": null,
"Seq": 83829,
"Type": "response"
}
Received response for /v2/blockstructure but could not find request.
Received response for /v2/blockstructure but could not find request.
Received response for /completion/resolve but could not find request.
Received response for /completion/resolve but could not find request. Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
Steps to reproduce
Whenever I open a script in unity this message happens.
Expected behavior
The c# extension works properly.
Actual behavior
No c# extension benefits to be found on my side unfortunately.
Steps I have taken to try to fix this: Installed .NET 6.0 Installed .NET 4.7.1 developer pack Changed omnisharp.path to latest installed an earlier version regenerated the .cs and .sln files in the project Then yesterday I was advised to try installing Visual Studio, which I did but the problem persists.
Please help, thank you.