PS D:worknetcorework> dotnet —info
.NET Core SDK(反映任何 global.json):
Version: 2.2.103
Commit: 8edbc2570a
运行时环境:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.2.103
Host (useful for support):
Version: 2.2.1
Commit: 878dd11e62
.NET Core SDKs installed:
2.2.103 [C:Program Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.1 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.1 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.1 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
omnisharp 1.18.0
when i installed other version (1.17.1) then this issues is nothing
@nczsl Can you share your «C#» log?
omnisharp log only show:
Error occured in loading omnisharp from omnisharp.path
Could not start the server due to Error: The system could not find the specified path
when vscode start time, or use omnisharp command in command board
that is empty, not exist any info
@nczsl Could you try uninstalling and then reinstalling the extension. When you reinstall you should see a C# log
that’s no different, uninstall and install omnisharp C# log still no info
@nczsl Does the .omnisharp folder exists in your .vscode/extensions/ms-vscode.csharp folder?
Could you try setting «omnisharp.path»: «latest» and restarting vscode ?
@nczsl Same issue, In my case because I was setted Omnisharp.Path=»absolute path» in vscode.
The problem was fixed after remove it.
VSCode->File->Preferences->Settings, Or press [Ctrl + ,] open settings panel,
search omnisharp.path, click [Edit in settings.json] edit json directly, remove «Omnisharp.Path»:»xxx» if it exists. Or correct it.
@nczsl Same issue, In my case because I was setted Omnisharp.Path=»absolute path» in vscode.
The problem was fixed after remove it.
VSCode->File->Preferences->Settings, Or press [Ctrl + ,] open settings panel,
search omnisharp.path, click [Edit in settings.json] edit json directly, remove «Omnisharp.Path»:»xxx» if it exists. Or correct it.
and restart vscode, then .. no use
hello can someone help me please im having this same issue
hello can someone help me please im having this same issue
I don’t know how to solve this problem. Later, I didn’t care about it, I didn’t use vscode for C# development, and I didn’t care about this problem ,because i use vs 2019. Now I’ve reinstalled the system for many times.I don’t know if this problem still exists in my vscode, As a digression, I use vscode to do typescript, which is really great, very good
well i fixed my issue by going to extensions and actually enabling the c# extension and then boom everything started working lol
I spent a lot of time trying to solve this problem, and the solution for me turned out to be simple — revert C# latest update:
- Open «Extensions» (Ctrl+Shift+X);
- Click on «gear» icon for the «C#» extension;
- Select «Install Another Version…«
- Select previous version («1.23.2» — works for me)
I spent a lot of time trying to solve this problem, and the solution for me turned out to be simple — revert C# latest update:
- Open «Extensions» (Ctrl+Shift+X);
- Click on «gear» icon for the «C#» extension;
- Select «Install Another Version…«
- Select previous version («1.23.2» — works for me)
not working… :/
I recently started coding in VSCode and had the same problem. I had the same problem but when I left path empty it works for me. Then omnisharp chooses the folder i have open in VSCode.
cut from settings.json —> «omnisharp.path»: «»,
Issue Description
Syntax highlighting breaks in an oddly specific case. Once it breaks, it’s broken to the EOF. I ran into this in a real piece of code and managed to distill it to the examples shown below.
As I write this, I see that Github’s syntax highlighting breaks in exactly the same way.
TL;DR; Workaround
UPDATE: Best option for Visual Studio Code, see answer below
Otherwise, wrap the part that breaks in parentheses as shown in the Steps to Reproduce
Steps to Reproduce
Try these code fragments
List
new List<string> { "a" as string ?? "b" as string, };
new
with known type. (Ignore the fact that Example
doesn’t actually exist, it does not affect the example)
new Example { Name = "a" as string ?? "b" as string, };
Anonymous type
new { Name = "a" as string ?? "b" as string, };
List without comma
new List<string> { "a" as string ?? "b" as string };
Workaround with parentheses
new List<string> { "a" as string ?? ("b" as string), };
Expected Behavior
The syntax highlighting works in all cases
Actual Behavior
In the first two snippets, the final as string
breaks.
The next two snippets illustrate that it is at least somewhat related to the Type specified before the {
, and the comma at the end of the line.
The last snippet illustrates the workaround I’m using, wrap the part that breaks in parentheses.
Logs
No relevant logging found
Environment information
VSCode version: 1.51.1
C# Extension: 1.23.6
Mono Information
OmniSharp using built-in mono
Dotnet Information
.NET Core SDK (reflecting any global.json):
Version: 3.1.404
Commit: 470f6754b3
Runtime Environment:
OS Name: debian
OS Version: 10
OS Platform: Linux
RID: debian.10-x64
Base Path: /usr/share/dotnet/sdk/3.1.404/
Host (useful for support):
Version: 3.1.10
Commit: 1721e39439
.NET Core SDKs installed:
2.2.402 [/usr/share/dotnet/sdk]
3.1.404 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.8 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
atlascode | atlassian | 2.8.5 |
clipboard-history | Anjali | 1.0.7 |
csharp | ms-dotnettools | 1.23.6 |
docomment | k—kato | 0.1.19 |
dotnet-test-explorer | formulahendry | 0.7.4 |
git-graph | mhutchie | 1.27.0 |
gitlens | eamodio | 11.0.5 |
markdown-all-in-one | yzhang | 3.4.0 |
swap-selection-with-clipboard | LukaszPolowczyk | 1.2.3 |
sync-scroll | dqisme | 1.3.0 |
todo-tree | Gruntfuggly | 0.0.188 |
vscode-markdownlint | DavidAnson | 0.37.2 |
vscode-nuget-package-manager | jmrog | 1.1.6 |
vscode-pull-request-github | GitHub | 0.21.2 |
vscode-yaml | redhat | 0.13.0 |
Environment data
VS Code version: 1.68.0
C# Extension version: 1.25.0
Azure Core tools: v4
powershell version: 7
OmniSharp error
Steps to reproduce
- Create azure powershell function
- Put a breakpoint anywhere and hit F5
- See error
Expected behavior
Should be able to debug the function
Actual behavior
Exception of type Omnisharp.Extensions.JsonRpc.RpcErrorException was thrown
Issue Description
Unity project, cannot open multiple projects
Steps to Reproduce
- According to the official guidance of vscode(https://code.visualstudio.com/docs/other/unity)
- Open a project with vscode
- Close vscode (note: not exit)
- Double-click the c# file in the Unity project again
- It will prompt: OmniSharp requires a complete install of Mono (including MSBuild) to provide language services when
omnisharp.useModernNet
is disabled in Settings. Please install the latest Mono and restart.
Expected Behavior
No prompts will pop up, and everything is fine.
Actual Behavior
A prompt window pops up and the language server is unavailable
Logs
OmniSharp log
Post the output from Output—>OmniSharp log here
C# log
Post the output from Output—>C# here
Environment information
VSCode version: 1.74.2
C# Extension: 1.25.2
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono’s ‘/bin’ folder is added to your environment’s PATH variable.
Dotnet Information
Command failed: dotnet —version
/bin/sh: dotnet: command not found
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
beautify | HookyQR | 1.5.0 |
better-comments | aaron-bond | 3.0.2 |
comment-translate | intellsmi | 2.2.4 |
csharp | ms-dotnettools | 1.25.2 |
eslint-rules-zh-plugin | maggie | 0.2.1 |
file-path-bar | wraith13 | 2.1.7 |
git-graph | mhutchie | 1.30.0 |
markdown-mermaid | bierner | 1.17.3 |
material-icon-theme | PKief | 4.23.1 |
material-theme | zhuangtongfa | 3.15.6 |
mermaid-markdown-syntax-highlighting | bpruitt-goddard | 1.5.0 |
path-intellisense | christian-kohler | 2.8.4 |
remote-explorer | ms-vscode | 0.0.3 |
remote-ssh | ms-vscode-remote | 0.94.0 |
remote-ssh-edit | ms-vscode-remote | 0.84.0 |
rust-analyzer | rust-lang | 0.3.1348 |
simple-react-snippets | burkeholland | 1.2.7 |
unity-debug | deitry | 3.0.11 |
vscode-deno | denoland | 3.15.0 |
vscode-docker | ms-azuretools | 1.23.3 |
vscode-drawio | hediet | 1.6.4 |
vscode-eslint | dbaeumer | 2.2.6 |
vscode-gutter-preview | kisstkondoros | 0.30.0 |
vscode-jest | Orta | 5.1.0 |
vscode-language-pack-zh-hans | MS-CEINTL | 1.74.12140931 |
vscode-markdown-paste-image | telesoho | 0.19.4 |
vscode-vlang | vlanguage | 0.1.14 |
Issue Description
When I declare a @code section in a Razor file, I don’t get any code actions (lightbulb suggestions).
Steps to Reproduce
- Create a new BlazorWasm project:
dotnet new blazorwasm -n wasm01
- Create a Models directory at the root and add a simple class there, using the Models namespace:
namespace wasm01.Models; public class Game { public int Id { get; set; } public required string Name { get; set; } }
- Try to use the new class in Index.razor:
@page "/" <PageTitle>Index</PageTitle> <h1>Hello, world!</h1> @code { private Game game = new(); }
- Put your cursor on the Game type.
Expected Behavior
If you hover over the Game type you should get a lightbulb and if you do CTRL+. you should get code suggestions, as it happens in OmniSharp version 1.25.2:
Actual Behavior
There’s no lightbulb suggesting the missing namespace. And, if you do CTRL+. (on Windows) it says «no code actions available»:
Logs
OmniSharp log
Starting OmniSharp server at 2/8/2023, 9:41:24 PM
Target: d:projectswasm01
OmniSharp server started with .NET 7.0.102
.
Path: c:Usersjulio.vscodeextensionsms-dotnettools.csharp-1.25.4-win32-x64.omnisharp1.39.4-net6.0OmniSharp.dll
PID: 38376
Starting OmniSharp on Windows 10.0.22621.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 2 MSBuild instance(s)
1: .NET Core SDK 7.0.102 17.4.1 — «C:Program Filesdotnetsdk7.0.102»
2: .NET Core SDK 7.0.101 17.4.0 — «C:Program Filesdotnetsdk7.0.101»
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 7.0.102 17.4.1 — «C:Program Filesdotnetsdk7.0.102»
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in ‘d:projectswasm01’.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in ‘d:projectswasm01’
info: OmniSharp.MSBuild.ProjectManager
Queue project update for ‘d:projectswasm01wasm01.csproj’
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in ‘d:projectswasm01’.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location ‘d:projectswasm01’ on host 20092.
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:projectswasm01PagesIndex.razor__virtual.cs added to workspace
info: OmniSharp.MSBuild.ProjectManager
Loading project: d:projectswasm01wasm01.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file ‘d:projectswasm01wasm01.csproj’.
info: OmniSharp.MSBuild.ProjectManager
Adding project ‘d:projectswasm01wasm01.csproj’
info: OmniSharp.MSBuild.ProjectManager
Update project: wasm01
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 13.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: d:projectswasm01PagesIndex.razor__virtual.cs, Line: 119, Column: 14.
C# log
EMPTY
Environment information
VSCode version: 1.75.0
C# Extension: 1.25.4
Dotnet Information
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk7.0.102
Host:
Version: 7.0.2
Architecture: x64
Commit: d037e070eb
.NET SDKs installed:
8.0.101 [C:Program Filesdotnetsdk]
7.0.102 [C:Program Filesdotnetsdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.12 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.12 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.12 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Other architectures found:
x86 [C:Program Files (x86)dotnet]
registered at [HKLMSOFTWAREdotnetSetupInstalledVersionsx86InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
blazorwasm-companion | ms-dotnettools | 1.1.4 |
copilot | GitHub | 1.71.8269 |
csharp | ms-dotnettools | 1.25.4 |
csharpextensions | kreativ-software | 1.7.3 |
data-workspace-vscode | ms-mssql | 0.4.0 |
gitlens | eamodio | 13.2.0 |
mongodb-vscode | mongodb | 0.10.0 |
mssql | ms-mssql | 1.17.1 |
rest-client | humao | 0.25.1 |
sql-bindings-vscode | ms-mssql | 0.3.0 |
sql-database-projects-vscode | ms-mssql | 0.21.0 |
vscode-dotnet-runtime | ms-dotnettools | 1.6.0 |
vscode-icons | vscode-icons-team | 12.2.0 |
Environment data
dotnet --info
output:
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Windows
OS Version: 10.0.15063
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.0.2
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
VS Code version: 1.18.1
C# Extension version: 1.13.1
Steps to reproduce
In open project, right-click open folder. Click add folder to workspace, then select a different C# project.
Expected behavior
Both folders will show intellisense, reference counters, have working goto definition, etc.
Actual behavior
The extension only seems to work with the first folder/project in the workspace. All other folders/projects have no reference counter, cannot detect code errors, and when clicking goto definition, it prompts that no definition was found.
Environment data
dotnet --info
output:
.NET Command Line Tools (2.1.4)
Product Information:
Version: 2.1.4
Commit SHA-1 hash: 5e8add2190
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.13
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.4/
Microsoft .NET Core Shared Framework Host
Version : 2.0.5
Build : 17373eb129b3b05aa18ece963f8795d65ef8ea54
VS Code version:
Version 1.20.1 (1.20.1)
C# Extension version:
1.14.0
Steps to reproduce
Create a file or rename a file and wait for Omnisharp to parse the file.
Expected behavior
VSCode should be able to find all existing namespace and assemblies.
Actual behavior
VSCode failed to find interfaces in the same namespace, and we can only reproduce it in current session, restarting VSCode, the issue is gone.
It seems Omnisharp somehow couldn’t recognize new file or renamed file are in the same namespace.
Screenshots
Existing file:
Create a new file with simple class name change:
Problems:
Restart or reload VSCode:
Currently, ASP.NET Core web apps created with «dotnet new» have HTTPS enabled by default. The very first time you debug (or, after dotnet dev-certs https --clean
), when no cert is created, debugging will fail, telling the user to run dotnet dev-certs https
, optionally with --trust
on Mac/Windows.
Similarly to how this extension suggests to create the tasks.json/launch.json when opening a C# project, I think it should prompt to do the above dotnet dev-certs https [--trust]
when opening an ASP.NET Core project when HTTPS is enabled on it, if no cert is already trusted.
On Windows, a popup asks if the user wants to trust the certificate; on Mac it requires password input, so it is still user-interactive, and the user needs to know to expect the popup if they say «Yes» to creating/trusting the cert. (On Linux there’s no centralized store for trusted certs, so this is moot there.)
*Copied from my other VSC bug report you can find here: microsoft/vscode#172368 (comment)
For more specific information scroll further, I filled in both.
Type: Bug
I don’t know, why. Theoretically it should be working.
- I create a new C# file in Unity and type «ejkhifkjefhgjksehfksjegfsjkefhsjkefse ejkfhkjefhsekjfgjik ekfhjgeshkjfghsehk» (without the «s) in the Update function.
- It doesn’t underline it and goes like «This is totally fine». No errors found, does my terminal/problems thing say. When I have C# selected. I have the extensions I would need, I even added NuGetAnalyzers but even they didn’t change a thing.
Potential clue: I observed this happening when I first opened a .TOML file from Minecraft configs, but I don’t know if this is the cause or just something that I noticed. Also, these colors are not the usual C# Unity Intellisense? The recommendation for words is working, but no error detection??? (See screenshots at the bottom)
I tried everything I could find to fix it, but it didn’t do anything (including restarting it about 20 times, not exaggerated). I am desperate for help at this point. Please help me.
VS Code version: Code 1.74.3 (97dec172d3256f8ca4bfb2143f3f76b503ca0534, 2023-01-09T16:59:02.252Z)
OS version: Windows_NT x64 10.0.19044
Modes:
Sandboxed: No
System Info
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz (4 x 3500) |
GPU Status | 2d_canvas: enabled canvas_oop_rasterization: disabled_off direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_renderer: enabled_on video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off |
Load (avg) | undefined |
Memory (System) | 23.95GB (5.98GB free) |
Process Argv | —crash-reporter-id 899bea0c-1702-4991-8a83-01ce0249fe7c |
Screen Reader | no |
VM | 0% |
Extensions (6)
Extension | Author (truncated) | Version |
---|---|---|
unity-debug | dei | 3.0.11 |
unity-code-snippets | kle | 1.3.0 |
git-graph | mhu | 1.30.0 |
csharp | ms- | 1.25.4 |
hlsltools | Tim | 1.1.303 |
unity-tools | Tob | 1.2.12 |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30410667
cppdebug:30492333
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
pyindex848cf:30577861
nodejswelcome1cf:30587006
3biah626:30602489
89544117:30613380
Images:
Prefilled from the specific Csharp bug report function I found by pressing F1
Issue Description
OmniSharp is not working properly, Intellisense broken, syntax highlighting not fit for C# Unity environment
Steps to Reproduce
Create a new C# file within Unity, open it up and type… just anything in the Update function.
For example: «wekufghhkegfhekjf ekjfhef»
If it doesn’t underline anything and the colors of the highlighting are not as expected (see screenshots above), you have my issue.
Expected Behavior
Intellisense working with Unity integration
Actual Behavior
It tells me there are no issues at all.
Logs
OmniSharp log
Starting OmniSharp server at 25.1.2023, 09:35:02
Target: f:3D_ProjekteRepoBurning TearsBurning Tears OnlineBurning Tears Online.sln
OmniSharp server started.
Path: c:UsersJoana.vscodeextensionsms-dotnettools.csharp-1.25.4-win32-x64.omnisharp1.39.4OmniSharp.exe
PID: 40996
[ERROR] Error: OmniSharp server load timed out. Use the ‘omnisharp.projectLoadTimeout’ setting to override the default delay (one minute).
C# log
Installing C# dependencies…
Platform: win32, x86_64
Downloading package ‘OmniSharp for Windows (.NET 4.7.2 / x64)’ (29097 KB)……………….. Done!
Validating download…
Integrity Check succeeded.
Installing package ‘OmniSharp for Windows (.NET 4.7.2 / x64)’
Finished
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Dotnet Information
.NET SDK:
Version: 7.0.101
Commit: bb24aafa11
Laufzeitumgebung:
OS Name: Windows
OS Version: 10.0.19044
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk7.0.101
Host:
Version: 7.0.1
Architecture: x64
Commit: 97203d38ba
.NET SDKs installed:
7.0.101 [C:Program Filesdotnetsdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.8 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.8 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.1 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
csharp | ms-dotnettools | 1.25.4 |
git-graph | mhutchie | 1.30.0 |
hlsltools | TimGJones | 1.1.303 |
unity-code-snippets | kleber-swf | 1.3.0 |
unity-debug | deitry | 3.0.11 |
unity-tools | Tobiah | 1.2.12 |
Issue Description
Go to definition navigates to Metadata instead of decompiled source code.
I am using Kubernetes client library and trying to navigate to the decompiled source code using «Go To Definition». However, I am being navigated to the Metadata for the navigated method instead of the decompile source code. Hovering over the method name when pressing the CMD key (I have different key mappings), it shows me» 2 implementation available». However, when I try navigating to implementation, I am given a «FileNotFound exception in the Omnisharp Logs and the editor window. The editor windows have error — «The editor could not be opened because the file was not found, Create File «.
The path shown in gutter is the same that I see in omnisharp logs — /$metadata$/Project/<Redacted>/<Redacted>/Assembly/KubernetesClient/Basic/Symbol/k8s/IAppsV1Operations.cs
I guess, $metadata$
is not resolved before handing over request to file system because when I click on «Create file», I get the following error in a popup window — Unable to write file /$metadata$/Project/<Redacted>/<Redacted>/Assembly/KubernetesClient/Basic/Symbol/k8s/IAppsV1Operations.cs' (Unknown (FileSystemError): Error: EROFS: read-only file system, mkdir '/$metadata$')
Steps to Reproduce
Expected Behavior
Should have navigated to decompiled source in editor.
Actual Behavior
Navigating to Metadata instead of source code. On next attempt of «go to definition» from the shown metadata, getting a File Not found error.
Logs
OmniSharp log
Starting OmniSharp server at 2/5/2023, 9:20:08 PM
Target: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/<Redacted>.sln
OmniSharp server started with .NET 7.0.102
.
Path: /Users/ankurtyagi/.vscode/extensions/ms-dotnettools.csharp-1.25.4-darwin-arm64/.omnisharp/1.39.4-net6.0/OmniSharp.dll
PID: 24665
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Unknown 0.0 (Unknown)
[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 4 MSBuild instance(s)
1: .NET Core SDK 7.0.102 17.4.1 - "/usr/local/share/dotnet/sdk/7.0.102/"
2: .NET Core SDK 7.0.101 17.4.0 - "/usr/local/share/dotnet/sdk/7.0.101/"
3: .NET Core SDK 6.0.405 17.3.2 - "/usr/local/share/dotnet/sdk/6.0.405/"
4: .NET Core SDK 6.0.403 17.3.2 - "/usr/local/share/dotnet/sdk/6.0.403/"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 7.0.102 17.4.1 - "/usr/local/share/dotnet/sdk/7.0.102/"
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc'.
[info]: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/<Redacted>.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc'.
[info]: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc' on host 24615.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/src/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/Users/ankurtyagi/workspace/Compute-CCI-ExecSvc/test/<Redacted>.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.MSBuild.ProjectManager
Update project: <Redacted>
[info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 158.
Received response for /v2/gotodefinition but could not find request.
Received response for /findusages but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: $metadata$/Project/<Redacted>/<Redacted>/Assembly/KubernetesClient/Basic/Symbol/k8s/IAppsV1Operations.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: $metadata$/Project/<Redacted>/<Redacted>/Assembly/KubernetesClient/Basic/Symbol/k8s/IAppsV1Operations.cs.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No document found. File: $metadata$/Project/<Redacted>/<Redacted>/Assembly/KubernetesClient/Basic/Symbol/k8s/IAppsV1Operations.cs.
C# log
Empty
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono’s ‘/bin’ folder is added to your environment’s PATH variable.
Dotnet Information
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.2
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.102/
Host:
Version: 7.0.2
Architecture: arm64
Commit: d037e070eb
.NET SDKs installed:
6.0.403 [/usr/local/share/dotnet/sdk]
6.0.405 [/usr/local/share/dotnet/sdk]
7.0.101 [/usr/local/share/dotnet/sdk]
7.0.102 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.11 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
auto-using | Fudge | 0.7.15 |
codespaces | GitHub | 1.13.7 |
copilot | GitHub | 1.71.8269 |
csharp | ms-dotnettools | 1.25.4 |
dotnet-test-explorer | formulahendry | 0.7.8 |
EditorConfig | EditorConfig | 0.16.4 |
intellij-idea-keybindings | k—kato | 1.5.5 |
namespace | adrianwilczynski | 1.1.2 |
nuget-reverse-package-search | jesschadwick | 0.1.68 |
powershell | ms-vscode | 2023.1.0 |
roslynator | josefpihrt-vscode | 4.2.0 |
vscode-icons | vscode-icons-team | 12.2.0 |
vscode-proto3 | zxh404 | 0.5.5 |
Environment data
VS Code version: 1.75.0
C# Extension version: 1.25.4
VS 2022: 17.4.4
Platform
- Windows
- Linux
- Mac
Steps to reproduce
- Open VS Code
- Go to https://github.com/OmniSharp/omnisharp-vscode/releases > Download the csharp-1.25.4-win32-x64.vsix.
- In VS Code and go to the Extensions Tab, select «Install from VSIX» > install the file you downloaded.
- After installing finished, there is one extension «C#» shows up.
Actual behavior:
After the installation is complete, No extensions found is displayed in INSTALLED.
Expected behavior:
After the installation is complete, there will show extension «C#» in INSTALLED.
Additional context:
Note:
- After the installation is complete, click Refresh and the extension «C#» will be displayed in INSTALLED.
- This issue does not repro on VS Code 1.74.3.
The option "razor.format.enable": false
is ignored and my cshtml document is formatted (badly). I have to set "razor.disabled": true
to keep the document untouched.
Plugin version: v1.25.4
Razor.VSCode version 7.0.0-preview.23067.5
Issue Description
Method definition with opening parenthesis on following line causes intellisense to stop working properly.
Example:
private void ExampleMethod
(
int param1,
int param2
{
// code from here will not be color coded
}
Steps to Reproduce
Paste the above code into a CSharp file. Code following the opening parenthesis will for the most part not be color coded properly.
Expected Behavior
Color coding should be consistent throughout the entire file.
Actual Behavior
Color coding after the opening parenthesis is not consistently color coded.
Logs
OmniSharp log
Post the output from Output—>OmniSharp log here
C# log
Post the output from Output—>C# here
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Mono Information
OmniSharp using mono: 6.12.0
Dotnet Information
.NET SDK:
Version: 7.0.100
Commit: e12b7af219
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.6
OS Platform: Darwin
RID: osx.12-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.100/
Host:
Version: 7.0.0
Architecture: arm64
Commit: d099f075e4
.NET SDKs installed:
7.0.100 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
csharp | ms-dotnettools | 1.25.4 |
gitlens | eamodio | 13.2.0 |
one-monokai | azemoh | 0.5.0 |
shader | slevesque | 1.1.5 |
unity-debug | Unity | 3.0.2 |
vscode-edit-csv | janisdd | 0.7.2 |
v1.25.4 doesn’t appear to have support for macOS Intel so does not show up as an available upgrade. The last upgrade available for macOS Intel is 1.25.2.
Forcing a refresh in VS Code to check for updates does not detect anything.
Looking in the Marketplace I can see 1.25.2 has a download for macOS Intel
1.25.4 does not have that entry
I do see that the release on GitHub for 1.25.4 has a csharp-1.25.4-darwin-x64.vsix
artifact so it looks like the build generated it, it just didn’t get pushed to the marketplace. Possible bug in the deployment pipeline?
Issue Description
When I try to format a Razor file, the formatting fails and I see an error.
Steps to Reproduce
- Create a
.cshtml
file - Add some markup (can be simple HTML)
- Format the document (either
alt+shift+f
or format on save)
Expected Behavior
The document is formatted and there are no errors
Actual Behavior
The document does not format and VS Code displays an error
razor-vscode-format-error.mp4
Logs
OmniSharp log
No errors
C# log
No errors
Razor Log
[Error - 6:07:07 PM] [null]
[Error - 6:07:07 PM] Request textDocument/formatting failed.
Message: Specified argument was out of the range of valid values. (Parameter 'Range start line 3 matches or exceeds SourceText boundary 3.')
Code: -32000
[object Object]
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Dotnet Information
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk7.0.102
Host:
Version: 7.0.2
Architecture: x64
Commit: d037e070eb
.NET SDKs installed:
3.0.100 [C:Program Filesdotnetsdk]
3.1.426 [C:Program Filesdotnetsdk]
5.0.408 [C:Program Filesdotnetsdk]
6.0.100 [C:Program Filesdotnetsdk]
6.0.201 [C:Program Filesdotnetsdk]
6.0.302 [C:Program Filesdotnetsdk]
6.0.308 [C:Program Filesdotnetsdk]
6.0.403 [C:Program Filesdotnetsdk]
6.0.405 [C:Program Filesdotnetsdk]
7.0.102 [C:Program Filesdotnetsdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.27 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.27 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.18 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.32 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.17 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.7 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.9 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.11 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.13 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.30 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.1.18 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.1.19 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 3.1.32 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 5.0.17 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.4 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.7 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.11 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.12 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 6.0.13 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.18 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.21 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.32 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.17 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.3 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.4 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.7 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.9 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.11 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.13 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.2 [C:Program FilesdotnetsharedMicrosoft.WindowsDesktop.App]
Other architectures found:
x86 [C:Program Files (x86)dotnet]
registered at [HKLMSOFTWAREdotnetSetupInstalledVersionsx86InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
azure-account | ms-vscode | 0.11.3 |
azure-pipelines | ms-azure-devops | 1.208.0 |
carbon-now-sh | ericadamski | 1.2.0 |
csharp | ms-dotnettools | 1.25.4 |
docomment | k—kato | 0.1.32 |
dotnet-test-explorer | formulahendry | 0.7.8 |
EditorConfig | EditorConfig | 0.16.4 |
githistory | donjayamanne | 0.6.19 |
gitlens | eamodio | 13.2.0 |
graphql-for-vscode | kumar-harsh | 1.15.3 |
intellicode-api-usage-examples | VisualStudioExptTeam | 0.2.7 |
lit-html | bierner | 1.11.1 |
LiveServer | ritwickdey | 5.7.9 |
markdown-preview-github-styles | bierner | 1.0.1 |
mermaid-markdown-syntax-highlighting | bpruitt-goddard | 1.5.0 |
nunjucks | ronnidc | 0.3.1 |
postcss | csstools | 1.0.9 |
powershell | ms-vscode | 2023.1.0 |
prettier-vscode | esbenp | 9.10.4 |
remote-wsl | ms-vscode-remote | 0.72.0 |
test-adapter-converter | ms-vscode | 0.1.6 |
user-secrets | adrianwilczynski | 2.0.1 |
volar | Vue | 1.0.24 |
vscode-azureresourcegroups | ms-azuretools | 0.5.6 |
vscode-docker | ms-azuretools | 1.23.3 |
vscode-drawio | hediet | 1.6.6 |
vscode-eslint | dbaeumer | 2.2.6 |
vscode-filesize | mkxml | 3.1.0 |
vscode-icons | vscode-icons-team | 12.2.0 |
vscode-less | mrmlnc | 0.6.3 |
vscode-markdownlint | DavidAnson | 0.49.0 |
vscode-mermaid-preview | vstirbu | 1.6.3 |
vscode-mysql | formulahendry | 0.4.1 |
vscode-scss | mrmlnc | 0.10.0 |
vscode-sqlite | alexcvzz | 0.14.1 |
vscode-stylelint | stylelint | 1.2.3 |
vscode-tailwindcss | bradlc | 0.9.6 |
vscode-versionlens | pflannery | 1.0.14 |
vscode-xml | redhat | 0.23.0 |
vscodeintellicode | VisualStudioExptTeam | 1.2.30 |
vsliveshare | ms-vsliveshare | 1.0.5823 |
Issue Description
When editing a Razor document, get constant popups «Request textDocument/onTypeFormatting failed.» When I click the «Go to output» button, I see the following errors logged:
Razor.VSCode version 7.0.0-preview.23067.5
Razor’s trace level is currently set to ‘Off’
- To change Razor’s trace level set ‘razor.trace’ to ‘Off’, ‘Messages’ or ‘Verbose’ and then restart VSCode.
- To report issues invoke the ‘Report a Razor issue’ command via the command palette.
[Error — 11:02:58 a.m.] [null]
[Error — 11:05:13 a.m.] [null]
[Error — 11:05:13 a.m.] Request textDocument/onTypeFormatting failed.
Message: Unhandled method textDocument/onTypeFormatting
Code: -32000
[object Object]
[Error — 11:05:16 a.m.] [null]
[Error — 11:05:16 a.m.] Request textDocument/onTypeFormatting failed.
Message: Unhandled method textDocument/onTypeFormatting
Code: -32000
[object Object]
Steps to Reproduce
With Csharp extension 1.25.4 installed, create a new MVC Web Application. Then just edit the Index.cshtml file by typing or pasting some code in. Any keypress results in the popup.
Expected Behavior
No errors when typing
Actual Behavior
Error when typing
Logs
OmniSharp log
Starting OmniSharp server at 2023-02-02, 10:25:28 a.m.
Target: /home/-/Programming/VSCode Projects/SignalR/SignalRSample
OmniSharp server started with .NET 6.0.113
.
Path: /home/-/.vscode/extensions/ms-dotnettools.csharp-1.25.4-linux-x64/.omnisharp/1.39.4-net6.0/OmniSharp.dll
PID: 10113
Starting OmniSharp on Unknown 0.0 (Unknown)
info: OmniSharp.Services.DotNetCliService
Checking the ‘DOTNET_ROOT’ environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
DotNetPath set to /usr/lib/dotnet/dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.113 17.0.1 — «/usr/lib/dotnet/sdk/6.0.113/»
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.113 17.0.1 — «/usr/lib/dotnet/sdk/6.0.113/»
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample’.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample’
info: OmniSharp.MSBuild.ProjectManager
Queue project update for ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj’
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample’.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample’ on host 9924.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj’.
info: OmniSharp.MSBuild.ProjectManager
Adding project ‘/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj’
info: OmniSharp.MSBuild.ProjectManager
Update project: SignalRSample
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
Received response for /v2/getcodeactions 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.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 8, Column: 0.
Received response for /completion/resolve 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/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 15, Column: 39.
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
«Type»: «request»,
«Seq»: 1891,
«Command»: «/close»,
«Arguments»: {
«FileName»: «/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs»
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (9.2403ms) ************
{
«Request_seq»: 1891,
«Command»: «/close»,
«Running»: true,
«Success»: false,
«Message»: «»System.ArgumentException: ‘Index.cshtml__bg__virtual.cs’ is not open.n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple4 data)\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate)n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler
2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\n at OmniSharp.Endpoint.EndpointHandler
2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258″»,
«Body»: null,
«Seq»: 28491,
«Type»: «response»
}
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
«Type»: «request»,
«Seq»: 1905,
«Command»: «/close»,
«Arguments»: {
«FileName»: «/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs»
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (0.8935ms) ************
{
«Request_seq»: 1905,
«Command»: «/close»,
«Running»: true,
«Success»: false,
«Message»: «»System.ArgumentException: ‘Index.cshtml__virtual.cs’ is not open.n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple4 data)\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate)n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler
2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\n at OmniSharp.Endpoint.EndpointHandler
2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258″»,
«Body»: null,
«Seq»: 30696,
«Type»: «response»
}
C# log
(empty)
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono’s ‘/bin’ folder is added to your environment’s PATH variable.
Dotnet Information
.NET SDK (reflecting any global.json):
Version: 6.0.113
Commit: 4a23b50f97
Runtime Environment:
OS Name: linuxmint
OS Version: 21.1
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/6.0.113/
global.json file:
Not found
Host:
Version: 6.0.13
Architecture: x64
Commit: 1af80ba017
.NET SDKs installed:
6.0.113 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions
Extension | Author | Version |
---|---|---|
brackets-light-pro | fehey | 0.4.6 |
cpptools-themes | ms-vscode | 2.0.0 |
csharp | ms-dotnettools | 1.25.4 |
dotnet-test-explorer | formulahendry | 0.7.8 |
github-plus-theme | thenikso | 1.4.3 |
gitlens | eamodio | 13.2.0 |
isort | ms-python | 2022.8.0 |
jupyter | ms-toolsai | 2022.11.1003412109 |
jupyter-keymap | ms-toolsai | 1.0.0 |
jupyter-renderers | ms-toolsai | 1.0.14 |
php-debug | xdebug | 1.31.0 |
python | ms-python | 2022.20.2 |
ruby | rebornix | 0.28.1 |
sqltools | mtxr | 0.27.1 |
sqltools-driver-mysql | mtxr | 0.5.1 |
vscode-icon-theme | jtlowe | 1.6.6 |
vscode-icons | vscode-icons-team | 12.2.0 |
vscode-intelephense-client | bmewburn | 1.9.4 |
vscode-jupyter-cell-tags | ms-toolsai | 0.1.6 |
vscode-jupyter-slideshow | ms-toolsai | 0.1.5 |
vscode-pull-request-github | GitHub | 0.56.0 |
vscode-pylance | ms-python | 2023.2.10 |
vscode-ruby | wingrunr21 | 0.28.0 |
Additional Information
May be related to #5561
Environment data
Operating system: MacOS High Sierra 10.13.6
dotnet --info
output:
Host (useful for support):
Version: 2.2.0
Commit: 1249f08fed
.NET Core SDKs installed:
2.1.4 [/usr/local/share/dotnet/sdk]
2.1.301 [/usr/local/share/dotnet/sdk]
2.1.302 [/usr/local/share/dotnet/sdk]
2.2.100 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
VS Code version: 1.29.1
C# Extension version: 1.17.1
mono version: 5.16.0.220
Steps to reproduce
Opening a C# file from Unity project.
Expected behavior
OmniSharp runs as normal. IntelliSense debugs code in real time.
Actual behavior
OmniSharp does not start. The output is as follows:
Starting OmniSharp server at 12/10/2018, 8:56:50 PM
Target: /Users/Shared/Unity/new_BattleForBFDIBattle/new_BattleForBFDIBattle.sln
OmniSharp server started with Mono 5.16.0.
Path: /Users/yazid/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/OmniSharp.exe
PID: 31933
Cannot open assembly '/Users/yazid/.vscode/extensions/ms-vscode.csharp-1.17.1/.omnisharp/1.32.8/omnisharp/OmniSharp.exe': No such file or directory.
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
It seems that there is no omnisharp.exe installed. I checked for the file by pressing Cmd+Shift+Period in Finder to view hidden files. Here’s a picture:
How do you install the omnisharp.exe file? Any help would be appreciated. Thank you for your time.
Environment data
dotnet --info
output:
.NET SDK:
Version: 7.0.102
Commit: 4bbdd14480
Runtime Environment:
OS Name: nixos
OS Version: 23.05
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/b5sc5y8f64bxl7bw835ayc4hnnndmhrx-dotnet-sdk-7.0.102/sdk/7.0.102/
Host:
Version: 7.0.2
Architecture: x64
Commit: d037e070eb
.NET SDKs installed:
3.1.426 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
6.0.405 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
7.0.102 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.32 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.13 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.32 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.13 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/nix/store/q2y79sgadi9sszfh86k7hs5dvr09blpn-dotnet-core-combined]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
VS Code version: 1.75.0
C# Extension version: 1.25.4 (but happens sinde v1.25.1-beta2 when #4738 got merged)
2023-02-05 16:09:02.874 [error] Activating extension ms-dotnettools.csharp failed due to an error:
2023-02-05 16:09:02.874 [error] Error: Error: Command failed: uname -m
/bin/sh: line 1: uname: command not found
/bin/sh: line 1: uname: command not found
at /nix/store/dq5cgsfmh9r491qwaiwi5mmln533gbfv-vscode-extension-ms-dotnettools-csharp-1.25.4/share/vscode/extensions/ms-dotnettools.csharp/dist/extension.js:2:763831
at ChildProcess.exithandler (node:child_process:415:5)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:526:28)
at Pipe.<anonymous> (node:net:687:12)
Steps to reproduce
- Open VSCode with v1.25.4
- Open Extension Host output
- See error
Expected behavior
Extension opens and works.
Actual behavior
Error when invoking uname -m
as we no longer inherit the process’ env vars.
Additional context
In NixOS, uname
is not located in neither /bin
nor /usr/bin
(which is what child_process
checks by default if env.PATH
is not specified), so the call to invoke uname
should include the process’ PATH
to be able to find it.
In my system it’s located at /run/current-system/sw/bin/uname
(which is a symlink that resolves to /nix/store/jynqcrh9yxh59w3sckkzmsz9n4r4iv0r-coreutils-full-9.1/bin/uname
but that could change at any moment so the most reliable method to find it to have the process’ PATH
).
This was introduced in #4738 which sends in an empty object to child_process
(and that makes in no longer inherit the env vars from process.env
).
I installed C# for Visual Studio Code (powered by OmniSharp) on my vscode (mac m1).
But I got this error in the output panel:
Starting OmniSharp server at 11/27/2022, 5:07:43 PM
Target: /Users/user/code/dotnet-microservices/PlatformService
OmniSharp server started with .NET 6.0.403
.
Path: /Users/user/.vscode-insiders/extensions/ms-dotnettools.csharp-1.25.2-darwin-arm64/.omnisharp/1.39.2-net6.0/OmniSharp.dll
PID: 25574
[STDERR] Unhandled exception.
[ERROR] A .NET 6 SDK for arm64 was not found. Please install the latest arm64 SDK from https://dotnet.microsoft.com/en-us/download/dotnet/6.0.
Not sure why. because I installed dotnet from https://dotnet.microsoft.com/en-us/download/dotnet/6.0
Arm64 | x64 (both versions I installed)
In my terminal, I run dotnet --version
and got 6.0.403
.
Why is vscode tell me to install the SDK I already installed?
Yesterday my VS Code updated Omnisharp, since then my intellisense and debugging messages are being outputted in another language from English, there doesn’t seem to be any way to configure or change that behaviour.
VSCode 1.75.0 running on Ubuntu 22.10
I have a set of projects where Intellisense just stops working. Everything seems fine on Windows but not on Ubuntu.
The problem can easily reproduced, just clone the following repo: https://github.com/chrissainty/blazor-in-action.git and open the chapter-11/BlazingTrails folder in VSCode. Then go to any .cs file and notice that there is no code lens or Intellisense.
Here is the output of the log. I did try the Trace log level but couldn’t see anything additional of use. Omnisharp simply stops at the last step.
[info]: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/peter/github/blazor-in-action/chapter-11/BlazingTrails/BlazingTrails.Tests/BlazingTrails.Tests.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
Adding project '/home/peter/github/blazor-in-action/chapter-11/BlazingTrails/BlazingTrails.Tests/BlazingTrails.Tests.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
Update project: BlazingTrails.Client
[info]: OmniSharp.MSBuild.ProjectManager
Update project: BlazingTrails.Shared
[info]: OmniSharp.MSBuild.ProjectManager
Update project: BlazingTrails.Api
[info]: OmniSharp.MSBuild.ProjectManager
Update project: BlazingTrails.ComponentLibrary
[info]: OmniSharp.MSBuild.ProjectManager
Update project: BlazingTrails.Tests
I have narrowed down the problem to the following in the .csproj files for the Client and ComponentLibrary:
<Target Name="CompileScopedScss" BeforeTargets="Compile"> <ItemGroup> <ScopedScssFiles Include="Features/**/*.razor.scss" /> </ItemGroup> <Exec Command="npm run sass -- %(ScopedScssFiles.Identity) %(relativedir)%(filename).css" /> </Target>
The problematic line is the Exec Command. Removing it solves the problem.
When this line is removed, the following additional content is output in the log:
[info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 88.
I’m a beginner programmer and I’ve been using VS Code for Mac to write console applications in C#. Usually, when I open VS Code, the «output» section shows it loads a few things including OmniSharp, and if I create a new console app a little box pops up asking if I want to download the relevant files.
I had to take a break for a couple months, and this week I’m back at it. I created a new console app via Terminal (as I usually do), opened it in VS Code, but the VS Code initialization messages ended with the following:
Starting OmniSharp server at 1/11/2021, 1:24:44 PM
Target: /Users/cutler 1 2/Documents/Coding/Practice Projects/CompareActors
OmniSharp server started.
Path: /Users/cutler 1 2/.vscode/extensions/ms-dotnettools.csharp-1.23.8/.omnisharp/1.37.5/run
PID: 89903
Cannot open assembly '1': No such file or directory.
[ERROR] Error: OmniSharp server load timed out. Use the 'omnisharp.projectLoadTimeout' setting to override the default delay (one minute).
And the little box asking me if I want to download relevant files never appeared. I have never messed with the location of OmniSharp so I don’t know why it would suddenly stop working. It’s allowing me to work on the program and run it, but OmniSharp isn’t working so there are no debugging files like launch.json
and no IntelliSense.
Based on my troubleshooting via google, I’ve tried:
-quitting and relaunching VS Code a few times (same error always occurs)
-going to the debug tab and clicking «Run and Debug,» which drops down a menu telling me to «Select Environment.» I select .NET Core
and the following error message pops up:
Cannot create .NET debug configurations. The OmniSharp server is still initializing or has exited unexpectedly.
-going to the debug tab and clicking «To customize Run and Debug, create a launch.json
file» (the file it creates is basically empty so I deleted it)
-uninstalling the C# extension from VS Code + going into the hidden files of VS Code in Finder and manually deleting the C# extension folder, then reinstalling it (same error occurred)
Does anyone have any idea how I might fix this?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
@bkmalkoc Спасибо за подачу. Не могли бы вы поделиться своим решением или рассказать мне больше о топологии вашего проекта / папки? Например, какие у вас есть ссылки на проекты, все ли эти проекты в одном решении и т. Д.?
@rchande
Топология проекта показана ниже. В основном в рамках одного решения, тестового проекта и основного кода в консольном приложении.
Также @bkmalkoc, что это за проекты? .NET Core, .NET Framework?
Здравствуйте. У меня такая же проблема сразу после обновления OmniSharp. Недавно было обновление от VS Code и dotnet-sdk, не уверен, связано ли это. Я использую Fedora 28.
@bkmalkoc @djkiwe Не могли бы вы попробовать обновить пакет dotnet SDK до версии 2.1.400 и сообщить мне, поможет ли это?
Я использую последнюю версию sdk.
Вывод dotnet --version
:
2.1.401
Вывод dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: fedora
OS Version: 28
OS Platform: Linux
RID: fedora.28-x64
Base Path: /usr/lib64/dotnet/sdk/2.1.401/
Host (useful for support):
Version: 2.1.3
Commit: N/A
.NET Core SDKs installed:
2.1.401 [/usr/lib64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.NETCore.App 2.1.3 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@djkiwe Пожалуйста, поделитесь своим журналом omnisharp. Благодаря!
Теперь, когда я дважды проверил, мой журнал показывает ошибки, отличные от ошибок OmniSharp.MSBuild.ProjectManager, Attemped to update project that is not loaded
.
Должен ли я открыть другой выпуск?
Спасибо!
@rchande @djkiwe Я обновил SDK для .Net Core до 2.1.401 (последняя версия), также обновил пакеты, но без изменений, все та же ошибка.
@bkmalkoc Можно ли поделиться только csprojs? Я не могу воспроизвести это с базовым выводом «dotnet new» …
HotelContentFetcher.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.S3" Version="3.3.23" />
<PackageReference Include="MySql.Data.EntityFrameworkCore" Version="8.0.12" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
</Project>
FetcherTests.csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..FetcherHotelContentFetcher.csproj" />
</ItemGroup>
</Project>
Эта же ошибка влияет и на меня, я больше не могу использовать Unity Debugger
Я полностью удалил все со своего компьютера (vscode, sdk), затем переустановил и теперь работает. странное и глупое решение, но, по крайней мере, я работаю. @rchande
@bkmalkoc Рад, что у вас все получилось. Не могли бы вы поделиться своим журналом dotnet --info
и omnisharp с рабочего экземпляра, чтобы помочь нам понять, как вы его исправили?
@rchande Я понятия не имею, что изменилось, но после чистой переустановки вот моя точка сети;
в omnisharp нет ничего плохого, работает с той же последней версией
dotnet —info
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.1.401
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.401 [C:Program Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@bkmalkoc рад, что у вас все заработало. Для других, которые все еще сталкиваются с проблемами:
Мы полагаем, что выявили причину проблемы «GetReferenceNearestTargetFrameworkTask» и создали бета-версию расширения C #, которое включает исправление. Установите бета-версию VSIX (https://github.com/OmniSharp/omnisharp-vscode/releases/download/v1.16.1-beta1/csharp-1.16.1-beta1.vsix) и сообщите нам, решит ли это проблему.
Я скачал и установил бета-версию, но ошибка не исчезла.
Я не уверен, получаю ли я ту же ошибку, что и другие парни, но вот что я вижу
Microsoft.Build.Exceptions.InvalidProjectFileException: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path 'C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0BinSdkResolversMicrosoft.Build.NuGetSdkResolverMicrosoft.Build.NuGetSdkResolver.xml'. SDK resolver path: C:Program Files (x86)Microsoft Visual Studio2017BuildToolsCommon7IDECommonExtensionsMicrosoftNuGetMicrosoft.Build.NuGetSdkResolver.dll d:temptemp-dotnettemp-hackerrankhackerrank-scratchpadarray-left-rotationarray-left-rotation.csproj
И вывод моего dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.1.401
Host (useful for support):
Version: 2.1.3
Commit: 124038c13e
.NET Core SDKs installed:
2.1.105 [C:Program Filesdotnetsdk]
2.1.200 [C:Program Filesdotnetsdk]
2.1.202 [C:Program Filesdotnetsdk]
2.1.300 [C:Program Filesdotnetsdk]
2.1.302 [C:Program Filesdotnetsdk]
2.1.400 [C:Program Filesdotnetsdk]
2.1.401 [C:Program Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.7 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.0 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
У меня недавно была эта проблема, я думал, что все установлено, даже моно, но у меня не было моно-полной установки, кажется, всего несколько пакетов, это решило мою проблему. Люди могут попробовать это и посмотреть, решит ли это их проблемы.
@rchande Я получаю ту же ошибку, используя как 1.16.2, так и 1.17.0 …
Проект был создан с использованием dotnet new console -o EfCoreTest
Журнал вывода VS Code выглядит следующим образом:
Starting OmniSharp server at 10/15/2018, 2:56:15 PM
Target: c:UsersFranklinDocumentsEfCoreTest
OmniSharp server started.
Path: C:UsersFranklin.vscodeextensionsms-vscode.csharp-1.17.0.omnisharp1.32.6OmniSharp.exe
PID: 5808
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 3 MSBuild instance(s)
1: Visual Studio Build Tools 2017 15.8.28010.2041 - "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Bin"
2: Visual Studio Community 2017 15.8.28010.2041 - "C:Program Files (x86)Microsoft Visual Studio2017CommunityMSBuild15.0Bin"
3: StandAlone 15.0 - "C:UsersFranklin.vscodeextensionsms-vscode.csharp-1.17.0.omnisharp1.32.6msbuild15.0Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Build Tools 2017 15.8.28010.2041 - "C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:UsersFranklinDocumentsEfCoreTest'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:UsersFranklinDocumentsEfCoreTest'
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:UsersFranklinDocumentsEfCoreTest'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:UsersFranklinDocumentsEfCoreTest' on host 8780.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj'.
c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path 'C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0BinSdkResolversMicrosoft.Build.NuGetSdkResolverMicrosoft.Build.NuGetSdkResolver.xml'. SDK resolver path: C:Program Files (x86)Microsoft Visual Studio2017BuildToolsCommon7IDECommonExtensionsMicrosoftNuGetMicrosoft.Build.NuGetSdkResolver.dll c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj
at Microsoft.Build.Shared.ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(Boolean condition, String errorSubCategoryResourceName, BuildEventFileInfo projectFile, Exception innerException, String resourceName, Object[] args)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.TryAddAssemblyFromManifest(String pathToManifest, String manifestFolder, List`1 assembliesList, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.FindPotentialSdkResolvers(String rootFolder, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverLoader.LoadResolvers(LoggingContext loggingContext, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.Initialize(LoggingContext loggingContext, ElementLocation location)
at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath)
at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.<>c__DisplayClass3_0.<ResolveSdk>b__0(String key)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Microsoft.Build.BackEnd.SdkResolution.CachingSdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath)
at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath)
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectLoader loader)
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader)
[fail]: OmniSharp.MSBuild.ProjectManager
Attemped to update project that is not loaded: c:UsersFranklinDocumentsEfCoreTestEfCoreTest.csproj
Вывод dotnet --info
:
.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:Program Filesdotnetsdk2.1.403
Host (useful for support):
Version: 2.1.5
Commit: 290303f510
.NET Core SDKs installed:
2.1.202 [C:Program Filesdotnetsdk]
2.1.401 [C:Program Filesdotnetsdk]
2.1.402 [C:Program Filesdotnetsdk]
2.1.403 [C:Program Filesdotnetsdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.3 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
Microsoft.NETCore.App 2.1.5 [C:Program FilesdotnetsharedMicrosoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
@FranklinWhale @farzadmf — у меня была та же проблема, что и у вас, и проблема в том, что Omnisharp выбирает экземпляр MS Build для Visual Studio Build Tools 2017, как указано ниже:
Registered MSBuild instance: Visual Studio Build Tools 2017 15.8.28010.2041
Как говорится в исключении, файл манифеста существует, но если вы посмотрите в него, он перечислит относительный путь, который должен перейти к преобразователю SDK. В пути нет ни указанного файла, ни некоторых папок.
Если вы проверите второй из перечисленных экземпляров MS Build, вы заметите, что путь действительно указывает на правильный файл.
Я не мог понять, как заставить Omnisharp выбрать другой экземпляр MS Build, поэтому исправление, которое я придумал, заключалось в том, чтобы просто удалить Visual Studio.
@ErikSharp Я нашел несколько обходных путей, которые
- этот обходной путь, связанный с удалением инструментов сборки
- Или этот обходной путь, чтобы переименовать там каталог
MSBuild
К сожалению, проблема здесь не кажется серьезной, поскольку никто из сопровождающих ее не прокомментировал.
@FranklinWhale Можете ли вы попробовать обходной путь, предложенный @farzadmf, и посмотреть, поможет ли это
@ akshita31 После удаления инструментов сборки ошибка больше не возникает.
@farzadmf Спасибо, что перечислили здесь обходные пути.
Я пока закрою этот выпуск. Не стесняйтесь открывать снова, если ошибка повторится снова.
Исправлено после копирования файла .sln в папку элемента .cproj.
@ akshita31 , @rchande : Есть ли
Та же проблема возникла после вчерашней установки средств сборки окон.
Привет! Любые обновления по этому поводу, так как у меня такая же проблема.
@FranklinWhale При установке Build Tools вы включали рабочую нагрузку .NET Core Build Tools?
@rchande Наверное, нет, потому что инструменты сборки предназначены только для C ++. Я создаю приложения .NET Core с помощью dotnet build
.
@FranklinWhale Как вы устанавливаете инструменты сборки?
@rchande
- Загрузите инструменты сборки для Visual Studio 2017 по адресу https://visualstudio.microsoft.com/downloads/#build -tools-for-visual-studio-2017.
- Запустите установщик
- Выберите инструменты сборки Visual C ++
+1 по этой проблеме, и, как было отмечено выше, удаление инструментов сборки не похоже на практическое / разумное решение.
У меня тоже есть эта проблема — в моем случае последняя установка Node (10.13.0) имела возможность установить инструменты сборки ms
@owensource @ mjharper84 @FranklinWhale Можете ли вы попробовать сделать то же самое и проверить, работает ли это?
@ akshita31 Это работает, и теперь я знаю через OmniSharp / omnisharp-roslyn # 1311, что:
- В настоящее время невозможно определить, присутствует ли поддержка .NET Core в MSBuild.
- Возможность контролировать использование MSBuild еще не реализована и в настоящее время отслеживается OmniSharp / omnisharp-roslyn # 1186
Та же проблема на MacBook Pro 15 2018, последняя версия Mojave. Проект создавался в виртуальных окнах.
В моем случае я обновил 2.1 до 2.2, а затем возникла та же проблема.
Еще одно: все хорошо работает в Visual Studio (в виртуальной Win 10), но не в Visual Studio Code (Mojave).
Я могу воспроизвести его и отправить вам отчет. Я выполнял свой проект на виртуальной машине, но это меня очень беспокоило. Мой ноутбук не может часами работать виртуально без плагина.
Исправлено переустановкой расширения Omnisharp в VS Code.
Всем, кто сталкивается с этой проблемой, необходимо установить рабочую нагрузку «.NET Core Build Tools» в Visual Studio.
Решением для меня было обновить csproj до версии 2.1 вместо 2.0, потому что у меня был установлен 2.1 sdk.
Я понимаю, что исходный плакат был в Windows, но эта проблема возникла у меня в Linux, и я не мог найти решение ни в одном из основных потоков. Не знаю почему, но в официальной монодокументации сказано:
Для установки всего необходимо установить пакет mono-complete — это должно охватывать большинство случаев ошибок «сборка не найдена».
В лучшем случае я чувствую, что это сильно вводит в заблуждение, поскольку он не устанавливает зависимостей компиляции. Если вы используете дистрибутив Linux, следуйте инструкциям по этой ссылке, чтобы установить пакет mono-devel. На момент написания это можно сделать с помощью: sudo apt install mono-devel
в Ubuntu 18.04. После этого вам может потребоваться также установить mono-complete, но это, наконец, исправило ошибки для меня.
Я столкнулся с этой проблемой и был решен путем удаления установленных мною инструментов сборки VS 2017.
@Moortiii Загрузка и установка Mono по вашей ссылке сработали для меня на MacOS Mojave 10.14.5. Благодаря!
Я использую Windows 10, использую VS Code, WSL и Spacemacs.
У меня тоже была эта проблема, и я обнаружил, что если я создаю свои проекты под WSL, с dotnet
, то есть dotnet под linux, у меня было много ссылок i obj/[project_name].csproj.nuget.dgspec.json
указывающих на Linux пути (/ mnt / etc) при использовании простых dotnet
и пути Windows (C: // etc) при использовании dotnet.exe
из WSL. Думаю, Omnisharp как-то нужна эта информация.
Удалив все мои папки obj (я удалил папки bin также на всякий случай) в рамках проекта и перезапустил VS Code, это помогло. Я получил обратно intellisense как в VS Code, так и в Spacemacs. Если вы используете WSL, создавайте свои проекты с помощью dotnet.exe
вместо простого dotnet
.
Надеюсь, это кому-то поможет.
разрешение при установке более старой и стабильной версии sdk
Была ли эта страница полезной?
0 / 5 — 0 рейтинги