ITADN

Razor source generator - The hintName must be unique within a generator

#9354OpenTranDucAnhh 创建于 2026-05-27
RazorC#DK
T
TranDucAnhhcommented
Type: <b>Bug</b> ## Issue Description ## ## Steps to Reproduce ## ## Expected Behavior ## ## Actual Behavior ## Extension version: 2.140.8 VS Code version: Code 1.121.0 (f6cfa2ea2403534de03f069bdf160d06451ed282, 2026-05-19T11:51:53+02:00) OS version: Windows_NT x64 10.0.26200 Modes: ### Logs ### <!-- If you can, it would be the most helpful to zip up and attach the entire extensions log folder. The folder can be opened by running the `workbench.action.openExtensionLogsFolder` command. Additionally, if you can reproduce the issue reliably, use trace logging, see https://github.com/dotnet/vscode-csharp/blob/main/SUPPORT.md#c-lsp-trace-logs and then report the issue. --> ### C# log ### <details> ``` 2026-05-27 19:48:04.540 [info] Installing C# dependencies... 2026-05-27 19:48:04.540 [info] 2026-05-27 19:48:04.540 [info] Platform: win32, x86_64 2026-05-27 19:48:04.540 [info] 2026-05-27 19:48:04.540 [info] Downloading package 'Language server for Roslyn Copilot integration' 2026-05-27 19:48:05.427 [info] (47 KB) 2026-05-27 19:48:05.428 [info] ....... 2026-05-27 19:48:05.634 [info] ....... 2026-05-27 19:48:05.639 [info] ...... 2026-05-27 19:48:05.640 [info] Done! 2026-05-27 19:48:05.641 [info] Validating download... 2026-05-27 19:48:05.641 [info] Integrity Check succeeded. 2026-05-27 19:48:05.641 [info] Installing package 'Language server for Roslyn Copilot integration' 2026-05-27 19:48:05.641 [info] 2026-05-27 19:48:05.655 [info] Downloading package 'VSWebAssemblyBridge (Platform Agnostic)' 2026-05-27 19:48:06.778 [info] (4143 KB) 2026-05-27 19:48:06.778 [info] . 2026-05-27 19:48:07.034 [info] 2026-05-27 19:48:07.269 [info] 2026-05-27 19:48:07.504 [info] 2026-05-27 19:48:07.527 [info] 2026-05-27 19:48:07.527 [info] . 2026-05-27 19:48:07.747 [info] 2026-05-27 19:48:07.768 [info] 2026-05-27 19:48:07.775 [info] 2026-05-27 19:48:07.783 [info] 2026-05-27 19:48:07.784 [info] . 2026-05-27 19:48:07.795 [info] 2026-05-27 19:48:07.993 [info] 2026-05-27 19:48:07.999 [info] 2026-05-27 19:48:08.015 [info] 2026-05-27 19:48:08.022 [info] . 2026-05-27 19:48:08.038 [info] 2026-05-27 19:48:08.041 [info] 2026-05-27 19:48:08.047 [info] 2026-05-27 19:48:08.514 [info] 2026-05-27 19:48:08.525 [info] . 2026-05-27 19:48:08.526 [info] 2026-05-27 19:48:08.526 [info] 2026-05-27 19:48:08.527 [info] 2026-05-27 19:48:08.527 [info] 2026-05-27 19:48:08.527 [info] . 2026-05-27 19:48:08.527 [info] 2026-05-27 19:48:08.528 [info] 2026-05-27 19:48:08.528 [info] 2026-05-27 19:48:08.528 [info] 2026-05-27 19:48:08.529 [info] . 2026-05-27 19:48:08.738 [info] 2026-05-27 19:48:08.792 [info] 2026-05-27 19:48:08.800 [info] 2026-05-27 19:48:09.085 [info] 2026-05-27 19:48:09.212 [info] . 2026-05-27 19:48:09.276 [info] 2026-05-27 19:48:09.284 [info] 2026-05-27 19:48:09.300 [info] 2026-05-27 19:48:09.306 [info] 2026-05-27 19:48:09.307 [info] . 2026-05-27 19:48:09.307 [info] 2026-05-27 19:48:09.307 [info] 2026-05-27 19:48:09.308 [info] 2026-05-27 19:48:09.333 [info] 2026-05-27 19:48:09.510 [info] . 2026-05-27 19:48:09.542 [info] 2026-05-27 19:48:09.548 [info] 2026-05-27 19:48:09.558 [info] 2026-05-27 19:48:09.563 [info] 2026-05-27 19:48:09.631 [info] . 2026-05-27 19:48:09.751 [info] 2026-05-27 19:48:09.775 [info] 2026-05-27 19:48:09.798 [info] 2026-05-27 19:48:09.800 [info] 2026-05-27 19:48:09.846 [info] . 2026-05-27 19:48:09.924 [info] 2026-05-27 19:48:09.962 [info] 2026-05-27 19:48:10.018 [info] 2026-05-27 19:48:10.036 [info] 2026-05-27 19:48:10.056 [info] . 2026-05-27 19:48:10.061 [info] 2026-05-27 19:48:10.069 [info] 2026-05-27 19:48:10.208 [info] 2026-05-27 19:48:10.251 [info] 2026-05-27 19:48:10.278 [info] . 2026-05-27 19:48:10.293 [info] 2026-05-27 19:48:10.309 [info] 2026-05-27 19:48:10.325 [info] 2026-05-27 19:48:10.431 [info] 2026-05-27 19:48:10.493 [info] . 2026-05-27 19:48:10.514 [info] 2026-05-27 19:48:10.534 [info] 2026-05-27 19:48:10.560 [info] 2026-05-27 19:48:10.567 [info] 2026-05-27 19:48:10.674 [info] . 2026-05-27 19:48:10.718 [info] 2026-05-27 19:48:10.746 [info] 2026-05-27 19:48:10.774 [info] 2026-05-27 19:48:10.782 [info] 2026-05-27 19:48:10.811 [info] . 2026-05-27 19:48:10.822 [info] 2026-05-27 19:48:10.939 [info] 2026-05-27 19:48:10.981 [info] 2026-05-27 19:48:11.009 [info] 2026-05-27 19:48:11.028 [info] . 2026-05-27 19:48:11.039 [info] 2026-05-27 19:48:11.061 [info] 2026-05-27 19:48:11.080 [info] 2026-05-27 19:48:11.211 [info] 2026-05-27 19:48:11.234 [info] . 2026-05-27 19:48:11.283 [info] 2026-05-27 19:48:11.290 [info] 2026-05-27 19:48:11.297 [info] 2026-05-27 19:48:11.316 [info] 2026-05-27 19:48:11.422 [info] . 2026-05-27 19:48:11.477 [info] 2026-05-27 19:48:11.493 [info] 2026-05-27 19:48:11.542 [info] 2026-05-27 19:48:11.867 [info] 2026-05-27 19:48:11.881 [info] Done! 2026-05-27 19:48:11.885 [info] Validating download... 2026-05-27 19:48:11.886 [info] Integrity Check succeeded. 2026-05-27 19:48:11.886 [info] Installing package 'VSWebAssemblyBridge (Platform Agnostic)' 2026-05-27 19:48:11.886 [info] 2026-05-27 19:48:12.027 [info] Finished 2026-05-27 19:48:12.027 [info] 2026-05-27 19:48:17.265 [info] Locating .NET runtime version 10.0.5 2026-05-27 19:48:17.398 [info] Dotnet path: C:\Program Files\dotnet\dotnet.exe 2026-05-27 19:48:17.398 [info] Activating C# + C# Dev Kit... 2026-05-27 19:48:19.175 [info] info: Program[0] 2026-05-27 19:48:19.175 [info] Server started with process ID 7328 2026-05-27 19:48:25.361 [info] [Program] Language server initialized 2026-05-27 19:48:25.364 [info] [Program] Monitoring client process 13432 for exit 2026-05-27 19:48:25.983 [info] [initialized] [Microsoft.CodeAnalysis.LanguageServer.FileBasedPrograms.FileBasedProgramsEntryPointDiscovery] Finished discovery in 'a:\StudioCode\Bcode\PhoneStore' in 8 milliseconds 2026-05-27 19:48:27.236 [info] [textDocument/diagnostic] [Microsoft.CodeAnalysis.MSBuild.BuildHostProcessManager] .NET BuildHost started from c:\Users\TranDucAnh\.vscode\extensions\ms-dotnettools.csharp-2.140.8-win32-x64\.roslyn\Microsoft.CodeAnalysis.LanguageServer.exe reloading to start from C:\Program Files\dotnet\dotnet.exe to match necessary SDK location. 2026-05-27 19:48:29.786 [warning] [textDocument/diagnostic] [LanguageServerProjectLoader] Project C:\Users\TranDucAnh\AppData\Local\Temp\roslyn-canonical-misc\bf5f25b0-1cf6-48a1-ba45-5d0f3028833e\Canonical.csproj has unresolved dependencies 2026-05-27 19:48:29.933 [info] [serviceBroker/connect] [WorkspaceProjectFactoryService] Project A:\StudioCode\Bcode\PhoneStore\PhoneStore.csproj loaded by C# Dev Kit 2026-05-27 19:48:29.983 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\Category.cs 2026-05-27 19:48:30.011 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Restoring Canonical.csproj: Running dotnet restore on C:\Users\TranDucAnh\AppData\Local\Temp\roslyn-canonical-misc\bf5f25b0-1cf6-48a1-ba45-5d0f3028833e\Canonical.csproj 2026-05-27 19:48:30.011 [info] [textDocument/diagnostic] [Microsoft.CodeAnalysis.LanguageServer.DotnetCliHelper] Using dotnet executable configured on the PATH 2026-05-27 19:48:30.850 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Restoring Canonical.csproj: Determining projects to restore... 2026-05-27 19:48:31.235 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Restoring Canonical.csproj: Restored C:\Users\TranDucAnh\AppData\Local\Temp\roslyn-canonical-misc\bf5f25b0-1cf6-48a1-ba45-5d0f3028833e\Canonical.csproj (in 108 ms). 2026-05-27 19:48:31.316 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Restore complete 2026-05-27 19:48:31.320 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:04.8460944 2026-05-27 19:48:31.788 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0005663 2026-05-27 19:49:18.734 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\Product.cs 2026-05-27 19:49:18.734 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0431311 2026-05-27 19:49:19.006 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\Product.cs 2026-05-27 19:49:19.006 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0073540 2026-05-27 19:49:40.142 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\User.cs 2026-05-27 19:49:40.143 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0275723 2026-05-27 19:50:01.670 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\Order.cs 2026-05-27 19:50:01.670 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0143834 2026-05-27 19:50:25.666 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\OrderItem.cs 2026-05-27 19:50:25.667 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0131302 2026-05-27 19:50:25.957 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\OrderItem.cs 2026-05-27 19:50:25.957 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0075101 2026-05-27 19:50:48.771 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:50:48.772 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:50:48.772 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:51:11.876 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\OrderItem.cs 2026-05-27 19:51:11.876 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0120955 2026-05-27 19:51:12.168 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\OrderItem.cs 2026-05-27 19:51:12.168 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0058834 2026-05-27 19:51:27.441 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:51:27.442 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:51:27.442 [warning] [textDocument/diagnostic] [LSP] Ignoring diagnostics request for untracked document: file:///a:/StudioCode/Bcode/PhoneStore/Models/OrderItem.cs 2026-05-27 19:51:42.867 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\TradeInRequest.cs 2026-05-27 19:51:42.867 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0126308 2026-05-27 19:51:43.149 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Models\TradeInRequest.cs 2026-05-27 19:51:43.150 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0067544 2026-05-27 19:52:18.515 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Data\PhoneStoreContext.cs 2026-05-27 19:52:18.516 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0282307 2026-05-27 19:52:18.815 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Data\PhoneStoreContext.cs 2026-05-27 19:52:18.815 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0048968 2026-05-27 19:53:27.430 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Controllers\AccountController.cs 2026-05-27 19:53:27.430 [info] [textDocument/diagnostic] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0097925 2026-05-27 19:53:27.752 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Controllers\AccountController.cs 2026-05-27 19:53:27.752 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0055530 2026-05-27 19:53:43.804 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Controllers\AdminController.cs 2026-05-27 19:53:43.804 [info] [textDocument/_vs_getProjectContexts] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0105888 2026-05-27 19:53:44.092 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Successfully completed load of a:\StudioCode\Bcode\PhoneStore\Controllers\AdminController.cs 2026-05-27 19:53:44.092 [info] [workspace/didChangeWatchedFiles] [LanguageServerProjectLoader] Completed (re)load of all projects in 00:00:00.0050165 2026-05-27 20:33:38.116 [error] Request textDocument/codeAction failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.118 [error] Request textDocument/documentSymbol failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.119 [error] Request textDocument/diagnostic failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.119 [error] Document pull failed for text document file:///a%3A/StudioCode/Bcode/PhoneStore/Views/Shared/_Layout.cshtml Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.126 [error] Request textDocument/inlayHint failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.165 [error] Request textDocument/codeAction failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.207 [error] Request textDocument/semanticTokens/range failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.300 [error] Request textDocument/codeLens failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:38.350 [error] Request textDocument/documentSymbol failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:40.161 [error] Request textDocument/semanticTokens/range failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] 2026-05-27 20:33:40.312 [error] Request textDocument/codeLens failed. Message: Razor source generator did not produce a host output for project 'PhoneStore': warning CS8785: Generator 'RazorSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'ArgumentException' with message 'The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName')'. System.ArgumentException: The hintName 'Views/_ViewImports_cshtml.g.cs' of the added source file must be unique within a generator. (Parameter 'hintName') at Microsoft.CodeAnalysis.AdditionalSourcesCollection.Add(String hintName, SourceText source) in /_/src/Compilers/Core/Portable/SourceGeneration/AdditionalSourcesCollection.cs:line 78 at Microsoft.CodeAnalysis.SourceOutputNode`1.AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken) in /_/src/Compilers/Core/Portable/SourceGeneration/Nodes/SourceOutputNode.cs:line 102 ----- Code: -32000 [object Object] ``` </details> ### C# LSP Trace Logs log ### <details> ``` ``` </details> ## Environment Information ## **VSCode version**: 1.121.0 **C# Extension**: 2.140.8 **Using OmniSharp**: false <details><summary>Dotnet Information</summary> .NET SDK: Version: 10.0.300 Commit: caa81fa497 Workload version: 10.0.300-manifests.e0989437 MSBuild version: 18.6.3+caa81fa49 Runtime Environment: OS Name: Windows OS Version: 10.0.26200 OS Platform: Windows RID: win-x64 Base Path: C:\Program Files\dotnet\sdk\10.0.300\ .NET workloads installed: There are no installed workloads to display. 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: 10.0.8 Architecture: x64 Commit: 94ea82652c .NET SDKs installed: 8.0.421 [C:\Program Files\dotnet\sdk] 10.0.300 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 10.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 8.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 10.0.8 [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_CLI_UI_LANGUAGE [en-US] global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download </details> <details><summary>Visual Studio Code Extensions</summary> |Extension|Author|Version|Folder Name| |---|---|---|---| |auto-rename-tag|formulahendry|0.1.10|formulahendry.auto-rename-tag-0.1.10| |cmake-tools|ms-vscode|1.23.52|ms-vscode.cmake-tools-1.23.52| |code-runner|formulahendry|0.12.2|formulahendry.code-runner-0.12.2| |codespaces|GitHub|1.18.13|github.codespaces-1.18.13| |cpp-devtools|ms-vscode|0.5.13|ms-vscode.cpp-devtools-0.5.13| |cpptools|ms-vscode|1.32.2|ms-vscode.cpptools-1.32.2-win32-x64| |cpptools-extension-pack|ms-vscode|1.5.1|ms-vscode.cpptools-extension-pack-1.5.1| |cpptools-themes|ms-vscode|2.0.0|ms-vscode.cpptools-themes-2.0.0| |csdevkit|ms-dotnettools|3.20.199|ms-dotnettools.csdevkit-3.20.199-win32-x64| |csharp|ms-dotnettools|2.140.8|ms-dotnettools.csharp-2.140.8-win32-x64| |debugpy|ms-python|2026.6.0|ms-python.debugpy-2026.6.0-win32-x64| |gitlens|eamodio|17.12.2|eamodio.gitlens-17.12.2| |java|redhat|1.54.0|redhat.java-1.54.0-win32-x64| |jupyter|ms-toolsai|2025.9.1|ms-toolsai.jupyter-2025.9.1-win32-x64| |jupyter-keymap|ms-toolsai|1.1.2|ms-toolsai.jupyter-keymap-1.1.2| |jupyter-renderers|ms-toolsai|1.3.0|ms-toolsai.jupyter-renderers-1.3.0| |LiveServer|ritwickdey|5.7.10|ritwickdey.liveserver-5.7.10| |material-icon-theme|PKief|5.35.0|pkief.material-icon-theme-5.35.0| |oracle-java|Oracle|25.1.0|oracle.oracle-java-25.1.0| |prettier-vscode|esbenp|12.4.0|esbenp.prettier-vscode-12.4.0| |python|ms-python|2026.4.0|ms-python.python-2026.4.0-win32-x64| |remote-wsl|ms-vscode-remote|0.104.3|ms-vscode-remote.remote-wsl-0.104.3| |vscode-dotnet-runtime|ms-dotnettools|3.0.2|ms-dotnettools.vscode-dotnet-runtime-3.0.2| |vscode-gradle|vscjava|3.17.3|vscjava.vscode-gradle-3.17.3| |vscode-java-debug|vscjava|0.59.0|vscjava.vscode-java-debug-0.59.0| |vscode-java-dependency|vscjava|0.27.4|vscjava.vscode-java-dependency-0.27.4| |vscode-java-pack|vscjava|0.31.0|vscjava.vscode-java-pack-0.31.0| |vscode-java-test|vscjava|0.45.0|vscjava.vscode-java-test-0.45.0| |vscode-jupyter-cell-tags|ms-toolsai|0.1.9|ms-toolsai.vscode-jupyter-cell-tags-0.1.9| |vscode-jupyter-slideshow|ms-toolsai|0.1.6|ms-toolsai.vscode-jupyter-slideshow-0.1.6| |vscode-maven|vscjava|0.45.3|vscjava.vscode-maven-0.45.3| |vscode-pylance|ms-python|2026.2.1|ms-python.vscode-pylance-2026.2.1| |vscode-python-envs|ms-python|1.30.0|ms-python.vscode-python-envs-1.30.0-win32-x64|; </details> <details><summary>C# Settings</summary> |Setting|Value| |---|---| |preferCSharpExtension|false| |compilerDiagnosticScope|openFiles| |analyzerDiagnosticScope|openFiles| |enableXamlTools|true| |useServerGC|true|; </details> <details> <summary>System Info</summary> |Item|Value| |---|---| |CPUs|AMD Ryzen 5 7640HS w/ Radeon 760M Graphics (12 x 4292)| |GPU Status|2d_canvas: enabled<br>GPU0: VENDOR= 0x1002, DEVICE=0x15bf [AMD Radeon(TM) 760M], DRIVER_VENDOR=AMD, DRIVER_VERSION=32.0.31007.5012 *ACTIVE*<br>GPU1: VENDOR= 0x10de, DEVICE=0x28e1 [NVIDIA GeForce RTX 4050 Laptop GPU], DRIVER_VERSION=32.0.16.1047<br>GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.26100.8328<br>Machine model name: <br>Machine model version: <br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>trees_in_viz: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off| |Load (avg)|undefined| |Memory (System)|15.31GB (1.98GB free)| |Process Argv|--crash-reporter-id 04f40075-b3eb-425d-9d45-a5e858033331| |Screen Reader|no| |VM|0%| </details><details> <summary>A/B Experiments</summary> ``` vsliv368:30146709 binariesv615:30325510 nativeloc1:31344060 dwcopilot:31170013 dwoutputs:31242946 copilot_t_ci:31333650 e5gg6876:31282496 pythonrdcb7:31342333 6518g693:31463988 aj953862:31281341 82j33506:31327384 6abeh943:31336334 envsdeactivate2:31505458 cloudbuttont:31379625 3efgi100_wstrepl:31403338 ec5jj548:31422691 cp_cls_t_966_ss:31454198 inlinechat_v2_hd992725:31505030 4je02754:31466945 8hhj4413:31478653 38bie571_auto:31426784 cp_cls_c_1081:31454833 conptydll_true:31498968 ia-use-proxy-models-svc:31452481 e9c30283:31461165 test_treatment2:31471001 46204921:31447328 control_6dc23131:31520950 idci7584:31464702 e3e4d672:31494082 ei9d7968:31496641 chat:31457767 8hig5102:31480529 89g7j272:31518289 7e187181:31503455 i2gc6536:31499202 52612955:31516516 ghj88844:31499326 ddid_t:31478206 hmra_i5g22:31518061 getcmakediagnosticson:31489824 7df3h592:31512476 cp_cls_t_1082:31516087 logging_enabled_new:31498466 j0d79568:31499440 nes-extended-cfe-himalia-004:31500446 jb_cp_cls_c_632:31517842 56dj4588:31512888 cg448276_tst_on:31514358 32d76977:31512328 ha629193:31508444 nes-charagree-3:31521372 539gd155_c:31506875 jh5f2457_c:31515489 61138546:31518536 nes-gb-5k:31521376 ``` </details> <!-- generated by issue reporter -->
0 条评论