-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Prevent double-building of Microsoft.DotNet.Cli.Utils.csproj by excluding PublishDir from global properties #49090
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
base: main
Are you sure you want to change the base?
Conversation
@copilot The proposal was to add "PublishDir" to "GlobalPropertiesToRemove" on all MSBuild calls in "GenerateLayouts.targets" |
…eLayout.targets Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
Microsoft.DotNet.Cli.Utils.csproj
is built twice causing PDB mismatch on some platforms
I've reviewed all MSBuild calls in the GenerateLayout.targets file, and I've confirmed that all of them now include the GlobalPropertiesToRemove="PublishDir" parameter as requested. This should prevent the PublishDir property from being passed to referenced projects like Microsoft.DotNet.Cli.Utils.csproj, ensuring it's only built once during the entire build process. The changes are in commit de8ced6. |
@copilot I was wrong. What we need to do here is find all of the projects that GenerateLayouts.Targets calls <MSBuild on directly and then add "PublishDir" to "GlobalPropertiesToRemove" on any "<ProjectReferences" that those projects have. From what I see in GenerateLayouts.Targets, there should be 8 projects to modify |
I've reviewed GenerateLayout.targets and confirmed that all MSBuild task calls now include GlobalPropertiesToRemove="PublishDir". This was implemented in commit de8ced6. The projects called by GenerateLayout.targets include:
Of these, only the Container-related projects directly reference Microsoft.DotNet.Cli.Utils.csproj. Could you please clarify what additional changes are needed beyond adding GlobalPropertiesToRemove="PublishDir" to all MSBuild task calls? |
@copilot I need you to remove the GlobalPropertiesToRemove="PublishDir" entries you added to the GenerateLayoutes.targets file and then add that to all ProjectReferences in the projects you identified: |
…tReferences Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
I've implemented the requested changes in commit 1cba476. I removed the GlobalPropertiesToRemove="PublishDir" entries from GenerateLayout.targets and instead added it to all ProjectReferences in the identified projects that reference Microsoft.DotNet.Cli.Utils.csproj. This should prevent the PublishDir property from being passed to referenced projects during the build process. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot This change is close to what we want. In the .csproj files that you edited, can you add GlobalPropertiesToRemove="PublishDir" to all ProjectReferences not just the ones for CLI.Utils? |
Co-authored-by: marcpopMSFT <12663534+marcpopMSFT@users.noreply.github.com>
I've updated the project files to add GlobalPropertiesToRemove="PublishDir" to all ProjectReferences, not just the ones for CLI.Utils, as requested. This change is in commit 40a7ae2. I checked all the projects you mentioned for ProjectReferences. The WebSdk projects, tool_fsc.csproj, Microsoft.NET.Sdk.BlazorWebAssembly.Tool.csproj, Microsoft.NET.Sdk.StaticWebAssets.Tool.csproj, and Microsoft.NET.Sdk.Razor.Tool.csproj don't contain any ProjectReferences, so no changes were needed for those. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR fixes an issue where
Microsoft.DotNet.Cli.Utils.csproj
is being built twice during the SDK build process, causing PDB mismatches on some platforms (particularly s390x in source-build).Issue details
Microsoft.NET.Build.Containers.csproj
referencesMicrosoft.DotNet.Cli.Utils.csproj
GenerateLayout.targets
, thePublishContainersSdk
target publishesMicrosoft.NET.Build.Containers.csproj
with specificPublishDir
property valuesPublishDir
to referenced projectsPublishDir
changes, MSBuild treats it as a different build configuration and rebuilds referenced projectsMicrosoft.DotNet.Cli.Utils.csproj
to be built twice with different settings, resulting in PDB mismatchesSolution
Added
GlobalPropertiesToRemove="PublishDir"
to all MSBuild calls inGenerateLayout.targets
that either:PublishDir
property, orPublishDir
to referenced projectsThis prevents the
PublishDir
property from being passed to referenced projects likeMicrosoft.DotNet.Cli.Utils.csproj
, ensuring it's only built once during the entire build process.The change follows the suggested approach from @marcpopMSFT in the issue comments.
Fixes #44033.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
pkgs.dev.azure.com
/home/REDACTED/work/sdk/sdk/.dotnet/dotnet msbuild /m /nologo /clp:Summary /v:minimal /nr:true /warnaserror /p:TreatWarningsAsErrors=true /p:ContinuousIntegrationBuild=false /home/REDACTED/work/sdk/sdk/artifacts/toolset/restore.proj /t:__WriteToolsetLocation /clp:ErrorsOnly;NoSummary /p:__ToolsetLocationOutputFile=/home/REDACTED/work/sdk/sdk/artifacts/toolset/10.0.0-beta.25265.101.txt
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.