Skip to content

Support .NET 10 single file projectless compile #532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2025
Merged

Conversation

adegeo
Copy link
Contributor

@adegeo adegeo commented Jun 24, 2025

Added detection for a single C# file in a directory with no other code files or projects above or below it. When this is triggered, it uses the C# file name as the project name, which lets us run dotnet build file.cs.

If the host is running .NET 9 or below, this just results in a compiler error because file.cs isn't a project, as expected. If the host is running .NET 10 or above, the compile runs normally and the only error reported is a true compiler error.

I added two additional tests (note that tests don't compile and check that portion of the project, they only test the detection engine):

  • Edit - Single file no project - Compile which tests the new .NET 10 projectless compile.
  • Delete - Single file find project C# which tests deleting a single file from a directory with a project and some other code file. This doesn't test anything new, it was just previously omitted.

@adegeo adegeo requested a review from BillWagner as a code owner June 24, 2025 22:06
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This lgtm @adegeo lets :shipit:

@BillWagner BillWagner merged commit 557c886 into main Jun 25, 2025
9 checks passed
@adegeo adegeo deleted the adegeo/snippets branch June 27, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants