Skip to content

VSCode keeps showing dialog when opening a c# file without having the solution opened #9296

@koepalex

Description

@koepalex

Environment data

dotnet --info output:

VS Code version:
.NET SDK:
 Version:           11.0.100-preview.3.26207.106
 Commit:            a8b33e7593
 Workload version:  11.0.100-manifests.b9faa06a
 MSBuild version:   18.6.0-preview-26207-106+a8b33e759

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.26200
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\11.0.100-preview.3.26207.106\

.NET workloads installed:
 [android]
   Installation Source: VS 18.6.11723.189
   Manifest Version:    36.1.99-preview.1.119/11.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\11.0.100-preview.1\microsoft.net.sdk.android\36.1.99-preview.1.119\WorkloadManifest.json
   Install Type:              Msi

 [maccatalyst]
   Installation Source: VS 18.6.11723.189
   Manifest Version:    26.2.11310-net11-p1/11.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\11.0.100-preview.1\microsoft.net.sdk.maccatalyst\26.2.11310-net11-p1\WorkloadManifest.json
   Install Type:              Msi

 [ios]
   Installation Source: VS 18.6.11723.189
   Manifest Version:    26.2.11310-net11-p1/11.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\11.0.100-preview.1\microsoft.net.sdk.ios\26.2.11310-net11-p1\WorkloadManifest.json
   Install Type:              Msi

 [maui-windows]
   Installation Source: VS 18.6.11723.189
   Manifest Version:    11.0.0-preview.1.26102.3/11.0.100-preview.1
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\11.0.100-preview.1\microsoft.net.sdk.maui\11.0.0-preview.1.26102.3\WorkloadManifest.json
   Install Type:              Msi

Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
  Version:      11.0.0-preview.3.26207.106
  Architecture: x64
  Commit:       a8b33e7593

.NET SDKs installed:
  8.0.421 [C:\Program Files\dotnet\sdk]
  9.0.314 [C:\Program Files\dotnet\sdk]
  10.0.108 [C:\Program Files\dotnet\sdk]
  10.0.300-preview.0.26177.108 [C:\Program Files\dotnet\sdk]
  11.0.100-preview.3.26207.106 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 11.0.0-preview.3.26207.106 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 11.0.0-preview.3.26207.106 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 8.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 9.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 11.0.0-preview.3.26207.106 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  DOTNET_ASPIRE_ALLOW_UNSECURED_TRANSPORT  [true]

global.json file:
  Not found

C# Extension version:
2.136.19

C# logs

C# output window contents:

See this page for collecting more detailed logs

Steps to reproduce

  1. Open a workspace that does not contain C# solution on root level
  2. Open a *. cs file

Expected behavior

I can open and edit the c# file and get at least LSP support (syntax highlighting).

Actual behavior

VSCode becomes unusable as there is a dialog "You must open a solution to enable C# editing features".
I understand but some of the editing/Advanced features are only available when the solution is loaded, but basic editing (as before) should be possible.
What makes it even worse, is that now VSCode is basically dead without open a solution, clicking Cancel will directly respawn the dialog with no time even to close the file.

Additional context

Add any other context about the problem here.

Image

VSCode Insider version:
Version: 1.121.0-insider (user setup)
Commit: c305abcf5246623ddb4e3f1be03f36e2f9dd7caf
Date: 2026-05-13T04:27:58Z
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions