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

dotnet build output directory is different on Linux #10550

jeffman opened this Issue Jan 7, 2019 · 3 comments


None yet
3 participants
Copy link

jeffman commented Jan 7, 2019

When I run dotnet build some-project -o some-folder, I get different behaviour on Linux compared to Windows. On Windows the output goes to ./some-folder, but on Linux the output goes to ./some-project/some-folder. I would expect it to behave the same as on Windows.

I can get around the issue by using full paths, however this adds a lot of clutter to my build scripts.

Steps to reproduce

dotnet new console -o project-folder
dotnet build project-folder -o other-folder

Expected behavior

Build output is copied to ./other-folder

Actual behavior

On Windows, build output is copied to ./other-folder
On Linux, build output is copied to ./project-folder/other-folder

Environment data

dotnet --info output on Windows:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview-009812
 Commit:    e3abf6e935

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.17763
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview-009812\

Host (useful for support):
  Version: 3.0.0-preview-27122-01
  Commit:  00c5c8bc40

.NET Core SDKs installed:
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.502 [C:\Program Files\dotnet\sdk]
  2.1.600-preview-009426 [C:\Program Files\dotnet\sdk]
  3.0.100-preview-009812 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview-18579-0056 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview-27122-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-alpha-27128-4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

dotnet --info output on Linux:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.101
 Commit:    236713b0b7

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.10
 OS Platform: Linux
 RID:         ubuntu.18.10-x64
 Base Path:   /usr/share/dotnet/sdk/2.2.101/

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  2.2.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

This comment has been minimized.

Copy link

livarcocc commented Jan 7, 2019

This is likely due to what the shells do on each OS, rather than some specific code we run per OS.

@peterhuene could you take a look and confirm?

@livarcocc livarcocc added this to the Discussion milestone Jan 7, 2019


This comment has been minimized.

Copy link

jeffman commented Jan 7, 2019

Thanks for the reply -- if it's indeed a shell issue then I should add that it happens in bash and PowerShell on Linux, but it doesn't happen in PowerShell on Windows.

@peterhuene peterhuene self-assigned this Jan 7, 2019


This comment has been minimized.

Copy link

peterhuene commented Jan 7, 2019

I remember a change in this area a while ago relating to relative path handling of the output directory option. I'll see what I can determine.

jeffman added a commit to jeffman/Mother2GbaTranslation that referenced this issue Jan 8, 2019

Re-organize build script and README
Convert build-tools to PowerShell. Note the use of full paths for dotnet's
output directory: dotnet/cli#10550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment