msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

DotNet build produces different result then building in visual studio

Open jogibear9988 opened this issue 2 years ago • 6 comments

Description

I use the following commandline:

 "C:\Program Files\dotnet\dotnet.exe" build MCC.sln --configuration Debug

if I do this, dotnet also copies the dlls of 2 projects wich are only "build dependecies" and not also refernences to the output directory.

Reproduction Steps

Download this sample: ConsoleApp1.zip

  • build it with visual studio. In the Folder: ConsoleApp1\bin\Debug\net7.0 you only get the files of the console app.
  • build it with dotnet build ConsoleApp1.sln you get both executables in the output

Expected behavior

  • only the one exe should be in the output

Actual behavior

both exe files are copied

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

jogibear9988 avatar Jan 10 '23 22:01 jogibear9988

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I use the following commandline:

 "C:\Program Files\dotnet\dotnet.exe" build MCC.sln --configuration Debug

if I do this, dotnet also copies the dlls of 2 projects wich are only "build dependecies" and not also refernences to the output directory.

Reproduction Steps

Download this sample: ConsoleApp1.zip

  • buuld it with visual studio. In the Folder: ConsoleApp1\bin\Debug\net7.0 you only get the files of the console app.
  • build it with dotnet build ConsoleApp1.sln you get both executables in the output

Expected behavior

  • only the one exe should be in the output

Actual behavior

both exe files are copied

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

No response

Author: jogibear9988
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

ghost avatar Jan 10 '23 22:01 ghost

@marcpopMSFT

For the particular issue this customer raised, that seems very much specific to their build rather than a bug so the person assigned would probably try to get some initial guidance on how to dig further and assign the milestone as discussion

sure? I added a sample... try build it with visual studio and dotnet and you get a different output

jogibear9988 avatar Jan 18 '23 07:01 jogibear9988

I was able to repro this and looked at the binlog. It looks like the AssignProjectConfiguration task is reading the dependency data from the solution and adding a project reference, which results in the output from the now-referenced project being included.

FYI @rainersigwald

dsplaisted avatar Jan 19 '23 00:01 dsplaisted

is this also broken in net6, or is it a regression?

jogibear9988 avatar Jan 19 '23 16:01 jogibear9988

any news here?

jogibear9988 avatar Feb 01 '23 21:02 jogibear9988

Any News? It's now broken over a year?

jogibear9988 avatar Jun 12 '24 17:06 jogibear9988