Skip to content

Add *.lscache to VisualStudio.gitignore#4839

Open
wherewhere wants to merge 1 commit intogithub:mainfrom
wherewhere:lscache
Open

Add *.lscache to VisualStudio.gitignore#4839
wherewhere wants to merge 1 commit intogithub:mainfrom
wherewhere:lscache

Conversation

@wherewhere
Copy link
Copy Markdown

Reasons for making this change

The C# Dev Kit create *.csproj.lscache in new version.

Links to documentation supporting these rule changes

Said by *.csproj.lscache

# This file caches language service data to improve the performance of C# Dev Kit.
# It is not intended for manual editing. It can safely be deleted and will be
# regenerated automatically.
#
# To exclude from version control, add *.lscache to your .gitignore file.

Merge and Approval Steps

  • Confirm that you've read the contribution guidelines and ensured your PR aligns
  • Ensure CI is passing
  • Get a review and Approval from one of the maintainers

@wherewhere wherewhere requested a review from a team as a code owner April 7, 2026 08:34
Copilot AI review requested due to automatic review settings April 7, 2026 08:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ignore pattern to the repository’s Visual Studio-focused .gitignore rules to prevent C# Dev Kit’s language service cache files (*.csproj.lscache) from being committed.

Changes:

  • Add *.lscache ignore entry for VS Code C# Dev Kit cache artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread VisualStudio.gitignore
*.msp

# VS Code C# Dev Kit
*.lscache
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd ask that this line is commented out by default and an explanation for why you'd want them ignored included, based on this issue by @JakeRadMSFT: microsoft/vscode-dotnettools#2961

From the issue:

What if I don't want them in source control?
We'd encourage you to try checking them in and experience the benefits, but we understand not every team will want that. You can add .lscache to your .gitignore if you prefer. You'll still get the per-machine caching benefits (warm starts when reopening the same project), you just won't get the cross-machine and branch-switching benefits. We're exploring configuration options to give users more control here.

@dooleydevin
Copy link
Copy Markdown
Collaborator

I'm open to discussion on this one, but I do think we shouldn't ignore any files by default that the maintainers of the tooling intend to be included in source control.

@wherewhere
Copy link
Copy Markdown
Author

This file contains a lot of local things such as /platform:x64 or <DOTNET>/sdk/10.0.300-preview.0.26177.108/Sdks/Microsoft.NET.Sdk/analyzers/build/config/analysislevel_10_default.globalconfig. It maybe changed every time when open the project on different devices. It should be treated like *.csproj.user which is related to local environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants