Skip to content

Clean up some file-based app APIs#53056

Merged
tmat merged 19 commits intodotnet:release/10.0.3xxfrom
jjonescz:virtual-proj-pkg
Feb 24, 2026
Merged

Clean up some file-based app APIs#53056
tmat merged 19 commits intodotnet:release/10.0.3xxfrom
jjonescz:virtual-proj-pkg

Conversation

@jjonescz
Copy link
Member

@jjonescz jjonescz commented Feb 17, 2026

Narrows down the API surface used by dotnet-watch.

Originally needed for NuGet/Home#14390 but not anymore (need to choose a different approach to avoid a source-build-incompatible dependency sdk->nuget).

@jjonescz jjonescz added the Area-run-file Items related to the "dotnet run <file>" effort label Feb 17, 2026
@jjonescz jjonescz marked this pull request as ready for review February 18, 2026 12:57
@jjonescz jjonescz requested review from a team and tmat as code owners February 18, 2026 12:57
@jjonescz jjonescz requested review from a team, Copilot and marcpopMSFT February 18, 2026 12:57
Copy link
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

This PR turns Microsoft.DotNet.ProjectTools into a shipping, packable package and exposes a minimal public API (VirtualProjectBuilder) intended to generate MSBuild project representations for file-based apps (per NuGet/Home#14390).

Changes:

  • Makes Microsoft.DotNet.ProjectTools packable/shipping and adds PublicAPI tracking files + repo-wide require_api_files enforcement.
  • Exposes VirtualProjectBuilder publicly and adds CreateProjectRootElement(...) to produce an MSBuild ProjectRootElement for a file-based program.
  • Narrows several previously-public helper types/APIs (launch settings + hashing) to internal and updates CLI call sites for a new CreateProjectInstance out parameter.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/dotnet-watch.Tests/dotnet-watch.Tests.csproj Adds a compile-time Microsoft.Build reference for tests (excluding runtime assets).
src/Microsoft.DotNet.ProjectTools/VirtualProjectBuilder.cs Publicizes the type and adds CreateProjectRootElement; threads ProjectRootElement out of project instance creation.
src/Microsoft.DotNet.ProjectTools/Utilities/Sha256Hasher.cs Changes hasher to internal to reduce public surface.
src/Microsoft.DotNet.ProjectTools/PublicAPI.Unshipped.txt Declares newly introduced public APIs for analyzer tracking.
src/Microsoft.DotNet.ProjectTools/PublicAPI.Shipped.txt Adds baseline shipped API file header.
src/Microsoft.DotNet.ProjectTools/Microsoft.DotNet.ProjectTools.csproj Marks project packable/shipping; adds PublicApiAnalyzers; adjusts dependencies and friend assemblies.
src/Microsoft.DotNet.ProjectTools/LaunchSettings/*.cs Makes launch-settings model types internal to keep package surface small.
src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs Updates call into VirtualProjectBuilder.CreateProjectInstance for new out param.
src/Cli/dotnet/Commands/Project/Convert/ProjectConvertCommand.cs Updates call into VirtualProjectBuilder.CreateProjectInstance for new out param.
.editorconfig Enables dotnet_public_api_analyzer.require_api_files = true.

Copy link
Member

@RikkiGibson RikkiGibson left a comment

Choose a reason for hiding this comment

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

Done review pass. Tomas's feedback seems reasonable to me

@jjonescz jjonescz requested a review from tmat February 19, 2026 09:51
@jjonescz jjonescz requested a review from RikkiGibson February 19, 2026 09:58
@tmat
Copy link
Member

tmat commented Feb 19, 2026

I also have some minor changes to the APIs in the pipeline: https://github.com/dotnet/sdk/pull/52648/changes#diff-6d5af1d6629956acc8f719ba30bbfd461bb7a0757e22f2ac7ccffab8591a88fe

Let me extract that to a separate PR.

@tmat
Copy link
Member

tmat commented Feb 19, 2026

Here it is: #53088

I have reduced the API surface that we need to be exposed for dotnet-watch.
We will need the IVT to dotnet-watch tests so that we can access string resources for validation.

Wanna cherry-pick my commit into this PR?

@jjonescz
Copy link
Member Author

jjonescz commented Feb 23, 2026

Reverted changes related to publishing a package consumable by nuget CLI, so this is now just a small cleanup of the API, mostly for dotnet-watch.

@jjonescz jjonescz marked this pull request as draft February 24, 2026 10:54
@jjonescz jjonescz changed the title Publish a package for creating file-based app virtual projects Clean up some file-based app APIs Feb 24, 2026
@jjonescz jjonescz marked this pull request as ready for review February 24, 2026 17:36
@jjonescz jjonescz requested a review from tmat February 24, 2026 17:36
@tmat tmat merged commit 8cbac4a into dotnet:release/10.0.3xx Feb 24, 2026
29 checks passed
tmat added a commit to tmat/dotnet that referenced this pull request Mar 12, 2026
commit 3d009596d1c130ded9be7576d45a4e3cc8a31d41
Author: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Date:   Thu Mar 12 08:10:03 2026 -0700

    [sdk] Source update 6e514f6 → 8cbac4a
    Diff: https://github.com/dotnet/sdk/compare/6e514f6189902a6422a6ab91324804c37035315b..8cbac4a5cdf27c2bb606a282cc47e60a7c4ced45

    From: dotnet/sdk@6e514f6
    To: dotnet/sdk@8cbac4a

    [[ commit created by automation ]]

```
C:\sdk>darc vmr forwardflow --build 303236 --vmr C:\dotnet
info: Flowing build 20260224.4 (303236) of commit 8cbac4a...
info: Making sure commit '8cbac4a5cdf27c2bb606a282cc47e60a7c4ced45' is present in repository 'C:\sdk'...
info: Flowing sdk's commit 8cbac4a to VMR at C:\dotnet...
info: Last flow was back flow: d346a57 -> f284d9f49aec157d49233ab5785cbcf78ed1ea58
info: Current flow is in the opposite direction
info: Creating a working branch darc/forward/8cbac4a-d346a57
info: Synchronizing sdk from 6e514f6189902a6422a6ab91324804c37035315b to https://github.com/dotnet/sdk / 8cbac4a5cdf27c2bb606a282cc47e60a7c4ced45
info: Updating VMR sdk from 6e514f6 to 8cbac4a..
info: Rebasing darc/forward/8cbac4a-d346a57 onto UpdateSdk1...
info: Auto-resolving expected conflicts...
info: Successfully auto-resolved 1 expected conflicts
info: Resolving dependency updates in source 6e514f6189902a6422a6ab91324804c37035315b..HEAD and target d346a57..UpdateSdk1
info: Changes staged in C:\dotnet
info: PRs from original repository included in this codeflow update:
      - dotnet/sdk#53090
      - dotnet/sdk#52347
      - dotnet/sdk#53100
      - dotnet/sdk#53056
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-run-file Items related to the "dotnet run <file>" effort

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants