dotnet / dotnet/msbuild

Discrepancy between build.cmd and IDE build

Open
#5,999 5 comments 0 reactions 1 assignee Claimed by @KirillOsenkov View on GitHub
Area: Our Own Build bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

When I type build.cmd to build the MSBuild repo on Windows it ends up with this command line:

```
/m /nologo /clp:Summary /v:minimal /nr:True /p:ContinuousIntegrationBuild=False /warnaserror /p:TreatWarningsAsErrors=true "C:\Users\kirill\.nuget\packages\microsoft.dotnet.arcade.sdk\1.0.0-beta.20580.3\tools\Build.proj" "/bl:C:\msbuild\artifacts\log\Debug\Build.binlog" "/p:Configuration=Debug" "/p:RepoRoot=C:\msbuild" "/p:Restore=True" "/p:DeployDeps=False" "/p:Build=True" "/p:Rebuild=False" "/p:Deploy=False" "/p:Test=False" "/p:Pack=False" "/p:IntegrationTest=False" "/p:PerformanceTest=False" "/p:Sign=False" "/p:Publish=False""
```

When I open MSBuild.Dev.sln in Visual Studio, some of these properties are not set, so the in-IDE behavior is slightly different. Specifically, projects always rebuild even if nothing has changed: this file: `C:\msbuild\artifacts\obj\Microsoft.Build.Framework\Debug\net472\Microsoft.Build.Framework.AssemblyInfo.cs` has an extra attribute (`[assembly: System.Reflection.AssemblyMetadataAttribute("RepositoryUrl", "https://github.com/microsoft/msbuild")]`) compared to the command-line build. It gets added because of a different default (`GenerateRepositoryUrlAttribute = true` in the IDE builds).

I think the default behavior for build.cmd should match as closely as possible the defaults picked by the build if you just do `msbuild /r /m /bl` with no extra properties. This way opening the solution in the IDE will result in the same builds instead of flip-flopping and competing with the command-line build and breaking incrementality.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.