This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new Issue.
This repository tracks issues related to the C# extension. Any issues related to the C# editing experience, Roslyn language server and other basic C# functionality should be filed here (regardless of if you're using C# Dev Kit or not).
For C# Dev Kit only features such as the Solution Explorer, Test Window, etc, please see https://github.com/microsoft/vscode-dotnettools/blob/main/SUPPORT.md
For help and questions about using this project, please see the README.
We highly recommend using the C# extension's built-in command, CSharp: Report an issue
(csharp.reportIssue
) to create a pre-filled issue template. This will include helpful details such as local dotnet installations, installed extensions, and other information.
The template has a section to include the C#
output window logs. These logs are not automatically included as they may contain personal information (such as full file paths and project names), but they are key to resolving problems.
-
Set the Log Level to Trace:
-
Reproduce the Issue:
- Perform the actions that reproduce the issue.
-
Copy the Logs:
- In the
C#
output window, select all the logs (e.g.,Ctrl+A
) and copy them. - Paste the logs into the issue template under the "C# Log" section.
- If necessary, redact sensitive information (e.g., file paths, project names).
- In the
-
Reset the Log Level:
- After collecting the logs, reset the log level to
Info
.
- After collecting the logs, reset the log level to
Note: If the issue occurs during extension startup, you can set Trace
as the default log level, restart VSCode, and the trace logs will be captured automatically.
- To capture detailed requests sent to the Roslyn language server:
- Set the
C#
output window log level toTrace
(as described above). - Open the
C# LSP Trace Logs
output window. - Reproduce the issue.
- Copy the contents of the
C# LSP Trace Logs
output window.
- Set the
- When launching VSCode from the CLI, pass the
--log ms-dotnettools.csharp:trace
parameter. - Invoke the
Developer: Set Log Level
command from the VSCode command palette, find theC#
entry, and set the level.
For issues with Razor, the Razor Log output window can contain useful information.
-
Set the Log Level to Trace:
-
Reproduce the Issue:
- Perform the actions that reproduce the issue.
-
Copy the Logs:
- Select all contents of the window (e.g.,
Ctrl+A
) and paste them into the GitHub issue when requested.
- Select all contents of the window (e.g.,
-
Reset the Log Level:
- Once the logs are collected, reset the log level to
Info
.
- Once the logs are collected, reset the log level to
Missing language features are often caused by a failure to load the project(s) or solution. To diagnose and resolve these issues, follow these steps:
-
Provide General Logs:
- Include the information from the issue template and the general logs (see the "Collecting General Logs" section above). These logs are essential for troubleshooting.
-
Check the Active Project Context:
-
Verify the Solution Explorer (C# Dev Kit):
- If you are using C# Dev Kit, check the Solution Explorer to ensure the project is displayed with the expected references.
- If the references or structure are not as expected, include the contents of the
Projects
output window in your issue report.
If you encounter issues with document classification (e.g., incorrect syntax highlighting or colorization), please provide the following information to help us diagnose the problem:
-
Theme in Use:
- Specify the name of the theme you are currently using in VSCode (e.g., "Dark+", "Light+", or a custom theme).
-
Tokens and Scope Information:
-
The
Developer: Inspect Editor Tokens and Scopes
command shows information about the problematic word or section:- Open the Command Palette (
Ctrl+Shift+P
orCmd+Shift+P
on macOS). - Search for and select
Developer: Inspect Editor Tokens and Scopes
(editor.action.inspectTMScopes
). - Click on the word or section with incorrect colorization to display the token and scope information.
- Open the Command Palette (
-
Take a screenshot of the output and include it in your issue report.
-
For issues with diagnostics, please provide values of the background analysis scope options, dotnet.backgroundAnalysis.analyzerDiagnosticsScope
and dotnet.backgroundAnalysis.compilerDiagnosticsScope
If the language server crashes, general logs are often helpful for diagnosing the issue. However, in some cases, logs alone may not provide enough information and we may need a crash dump. Follow these steps to collect a crash dump:
- Set the
dotnet.server.crashDumpPath
setting in VSCode to a user-writable folder where crash dumps can be saved. - Reproduce the issue
- When the server crashes, a dump in the specified folder will be created.
Warning
The dump can contain detailed information on the project - generally we will provide an email so that it can be shared privately
Support for this project is limited to the resources listed above.