Search code examples
asp.net-core.net-corepublishgit-bash

dotnet publish with absolute path do not respect output


Repro

On windows with git bash:

I created some asp net core web app with razor pages. Now I would like to publish it to directory.

dotnet publish -o C:\temp\myApp

Temp directory exists, wheras MyApp not exists yet.

Problem

dotnet publish to ..\currentProjectDirectory\tempmyApp

Why its happens? I have also tried to run git bash with admin permissions, but it has not helped.


Solution

  • You use git bash. It means you should use linux-style path:

    dotnet publish -o /c/temp/myApp