Skip to content
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

Add support for --disable-build-servers to more MSBuild-driven commands #31651

Closed
baronfel opened this issue Apr 6, 2023 · 4 comments · Fixed by #33445
Closed

Add support for --disable-build-servers to more MSBuild-driven commands #31651

baronfel opened this issue Apr 6, 2023 · 4 comments · Fixed by #33445
Assignees
Labels
Milestone

Comments

@baronfel
Copy link
Member

baronfel commented Apr 6, 2023

Is your feature request related to a problem? Please describe.

In .NET 7 we added the --disable-build-servers option to build, restore, and publish to make it easier for developers to have complete control over the use of build servers of all kinds in their builds. Some commands that are still driven by MSBuild are missing in that set, so we should add support to ensure that there is a consistent set of behaviors across all MSBuild-driven commands.

Describe the solution you'd like

We should add the --disable-build-servers option to the following commands:

  • clean
  • test
  • run
  • pack
  • msbuild
@KalleOlaviNiemitalo
Copy link
Contributor

Can dotnet list package start MSBuild servers?

@marcpopMSFT marcpopMSFT self-assigned this Apr 11, 2023
@marcpopMSFT marcpopMSFT added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member needs team triage Requires a full team discussion labels Jun 1, 2023
@marcpopMSFT marcpopMSFT assigned MiYanni and unassigned marcpopMSFT Jun 6, 2023
@marcpopMSFT marcpopMSFT added this to the 8.0.1xx milestone Jun 6, 2023
@MiYanni
Copy link
Member

MiYanni commented Jun 19, 2023

Research

Just FYI, here are the current commands using this feature:
image

This means, out of the original list for the issue, only run doesn't have the option.

Here are the commands that implement MSBuildForwardingApp. Meaning, these commands invoke MSBuild:
image

FYI, RestoringCommand is a base for these commands that do a restore operation:
image

Notes

  • dotnet list package uses and instance of NuGetForwardingApp. So, that doesn't use MSBuild and should not have this option.
  • dotnet run creates an instance of RestoringCommand to ensure the project is built. Therefore, it should have this option.

@KalleOlaviNiemitalo
Copy link
Contributor

KalleOlaviNiemitalo commented Jun 20, 2023

OK, I see dotnet list package requires a NuGet assets file and fails if NuGet packages have not been restored, so I presume it doesn't query MSBuild for PackageReference items.

How about dotnet list reference though? That doesn't need an assets file. Does it call any MSBuild targets in order to find the ProjectReference items; can it start build servers?

@MiYanni
Copy link
Member

MiYanni commented Jun 20, 2023

Looks like dotnet list reference uses the MSBuild SDK to get the list of project-to-project references. It doesn't run MSBuild either.

Based on what I've investigated, I'm adding the option to both run and store. Going to make some unit tests right now for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants