Skip to content

[WebToolsE2E][Blue]Error " Exception thrown: System.InvalidOperationException: The solution does not contain the specified document. "show up when open _Layout.cshtml file #8474

@Susie-1989

Description

@Susie-1989

REGRESSION INFO: Works well in public Pre-release C# 2.87.26

INSTALL STEP

  1. Repro OS: Win11 24H2 ENU
  2. Install latest VSCode (latest released version 1.103.0-insider)
  3. Install SDK 10.0 Preview 6
  4. Install C# main version: 2.88.27

REPRO STEPS

  1. Create razor project
md razor
cd razor
dotnet new razor
  1. Open this folder with vs code and open Pages/Shared/_Layout.cshtml.
  2. Close this folder and reopen this folder.

Note: Some times the error show up when only do step#1, step#2

ACTUAL "Restore completed with errors "show up

Image

C# log:

2025-07-31 10:30:16.272 [info] Locating .NET runtime version 9.0.1
2025-07-31 10:30:16.272 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe
2025-07-31 10:30:16.272 [info] Activating C# standalone...
2025-07-31 10:30:16.638 [info] [stdout] info: Program[0]
      Server started with process ID 16636

2025-07-31 10:30:17.646 [info] [stdout] {"pipeName":"\\\\.\\pipe\\e4562170"}

2025-07-31 10:30:17.646 [info] received named pipe information from server
2025-07-31 10:30:17.647 [info] client has connected to server
2025-07-31 10:30:17.909 [info] [Info  - 10:30:17 AM] [Program] Language server initialized
2025-07-31 10:30:38.708 [info] Locating .NET runtime version 9.0.1
2025-07-31 10:30:38.923 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe
2025-07-31 10:30:38.923 [info] Activating C# standalone...
2025-07-31 10:30:39.184 [info] [stdout] info: Program[0]
      Server started with process ID 10868

2025-07-31 10:30:40.313 [info] [stdout] {"pipeName":"\\\\.\\pipe\\45285184"}

2025-07-31 10:30:40.313 [info] received named pipe information from server
2025-07-31 10:30:40.315 [info] client has connected to server
2025-07-31 10:30:40.491 [info] [Info  - 10:30:40 AM] [Program] Language server initialized
2025-07-31 10:30:51.934 [info] [Info  - 10:30:51 AM] [project/open] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:30:51.940 [info] [Info  - 10:30:51 AM] [project/open] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:09.9663529
2025-07-31 10:30:55.438 [info] [Error - 10:30:55 AM] [workspace/_roslyn_restore] [Microsoft.CodeAnalysis.LanguageServer.Handler.RestoreHandler] Restore completed with errors. See '.NET NuGet Restore' output window for more details.
2025-07-31 10:31:39.562 [info] [Info  - 10:31:39 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:31:39.562 [info] [Info  - 10:31:39 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:02.0313589
2025-07-31 10:31:42.448 [info] [Info  - 10:31:42 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:31:42.448 [info] [Info  - 10:31:42 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:02.6312720
2025-07-31 10:31:44.585 [info] [Info  - 10:31:44 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:31:44.585 [info] [Info  - 10:31:44 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:02.0061920
2025-07-31 10:31:46.788 [info] [Info  - 10:31:46 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:31:46.788 [info] [Info  - 10:31:46 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:02.0919693
2025-07-31 10:31:49.924 [info] [Info  - 10:31:49 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:31:49.924 [info] [Info  - 10:31:49 AM] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:01.7636574
2025-07-31 10:32:26.596 [info] Locating .NET runtime version 9.0.1
2025-07-31 10:32:26.846 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe
2025-07-31 10:32:26.846 [info] Activating C# standalone...
2025-07-31 10:32:27.436 [info] [stdout] info: Program[0]
      Server started with process ID 8604

2025-07-31 10:32:28.425 [info] [stdout] {"pipeName":"\\\\.\\pipe\\f001474b"}

2025-07-31 10:32:28.425 [info] received named pipe information from server
2025-07-31 10:32:28.426 [info] client has connected to server
2025-07-31 10:32:28.595 [info] [Info  - 10:32:28 AM] [Program] Language server initialized
2025-07-31 10:32:36.461 [info] [Info  - 10:32:36 AM] [project/open] [LanguageServerProjectLoader] Successfully completed load of c:\Users\v-yuwzh\test7\test7.csproj
2025-07-31 10:32:36.472 [info] [Info  - 10:32:36 AM] [project/open] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:06.6285705

EXPECTED No error show up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions