You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
publish command not copying files to specified output directory #6687
If I try /bin/output I get the error: Access to the path '/bin/output' is denied. Is this expected? I'm guessing so as it looks to be going to the root directory of my drive first
if I add ../ the folders are not copied/created like I would expect. Only the .dlls and .pdbs are copied. dotnet publish --configuration Release --version-suffix 45 --output ../bin/output/
I have the same issue when using the image microsoft/aspnetcore-build:1.1.1 and running dotnet publish src/MyProj --output out --configuration Release. Running on ubutnu. Nothing gets copied and no error messages.
EDIT: It works but I was confused by the fact that the output option path is relative to the project path, not the current working dir. Sorry for the noise.
Reacted by urbanhusky, Adrian Hesketh, Ted B, Victor Alves and ryanpfalz
The only hint currently is that the defaults are relative to the project.
dotnet publish -o did not treat relative paths relative to the project but to the current directory in previous versions (migrated from 1.1 preview 2.1)
I migrated from 1.0.2 with SDK Preview 2 build 3148 to the latest full release 1.0.5 with SDK 1.0.4 and the --output also changed from relative to current path to the project path.
@mairaw will those commits you did on dotnet/docs#3042 also apply to .NET Core 1.0, given that the documentation for dotnet publish currently states it applies to .NET Core 1.x and .NET Core 2.x ?
that's the change I made @lantrix. But if that's not correct, I'm happy to review that PR. I'm still waiting for review on that one from either @livarcocc or @nguerrera.
I made a last-minute PR (dotnet/cli#7166) but that was too late to get into 2.* so it will have to wait for a major version increment to introduce this now breaking change..
Activity
deathrowe commentedon Jul 27, 2016
Looks to only be an issue if I use a relative path for the output option
brthor commentedon Jul 27, 2016
@ajaybhargavb
ajaybhargavb commentedon Jul 27, 2016
@deathrowe, could you try without the
./?dotnet publish --configuration Release --version-suffix 45 --output bin/output/deathrowe commentedon Jul 27, 2016
ok, without the
./does work.If I try
/bin/outputI get the error: Access to the path '/bin/output' is denied. Is this expected? I'm guessing so as it looks to be going to the root directory of my drive firstdeathrowe commentedon Jul 27, 2016
if I add
../the folders are not copied/created like I would expect. Only the .dlls and .pdbs are copied.dotnet publish --configuration Release --version-suffix 45 --output ../bin/output/u-abramchuk commentedon Aug 3, 2016
Hi, I have the same issue.
In project.json I have
"publishOptions": { "includeFiles": [ "appsettings.json", "web.config" ] }When running
dotnet publishordotnet publish -c Releasethese files are copied to publish folder.
But when I run
dotnet publish -o ..\..\outputthey are not copied like I would expect.
severisv commentedon Aug 5, 2016
The error occurs when the target project is not specified as an argument
Does not work (files specified in publishOptions in project.json are not copied):
dotnet publish --configuration Release -o myPublishDirectoryWorks:
dotnet publish --configuration Release -o myPublishDirectory ./TheRealPiotrP commentedon Nov 12, 2016
I've not been able to repro this after migrating to csproj in preview3. If someone has a csproj repro, please share and reopen!
jonaskello commentedon Apr 5, 2017
I have the same issue when using the image
microsoft/aspnetcore-build:1.1.1and runningdotnet publish src/MyProj --output out --configuration Release. Running on ubutnu. Nothing gets copied and no error messages.EDIT: It works but I was confused by the fact that the output option path is relative to the project path, not the current working dir. Sorry for the noise.
SteveDesmond-ca commentedon Apr 21, 2017
I just hit this too -- is there documentation anywhere that says that the output dir is relative to the project file, not the current working dir?
urbanhusky commentedon May 3, 2017
The only hint currently is that the defaults are relative to the project.
dotnet publish -odid not treat relative paths relative to the project but to the current directory in previous versions (migrated from 1.1 preview 2.1)lantrix commentedon Sep 19, 2017
@urbanhusky I've also found the same in .NET Core 1.0.
I migrated from
1.0.2 with SDK Preview 2 build 3148to the latest full release1.0.5 with SDK 1.0.4and the--outputalso changed from relative to current path to the project path.@mairaw will those commits you did on dotnet/docs#3042 also apply to .NET Core 1.0, given that the documentation for dotnet publish currently states it applies to .NET Core 1.x and .NET Core 2.x ?
mairaw commentedon Sep 19, 2017
that's the change I made @lantrix. But if that's not correct, I'm happy to review that PR. I'm still waiting for review on that one from either @livarcocc or @nguerrera.
dasMulli commentedon Sep 19, 2017
I made a last-minute PR (dotnet/cli#7166) but that was too late to get into 2.* so it will have to wait for a major version increment to introduce this now breaking change..
lantrix commentedon Sep 25, 2017
@mairaw Your documentation change is correct to document current behaviour. I see it is now merged and published too. Thanks!
mairaw commentedon Sep 25, 2017
cool! Thanks for confirming that @lantrix!
jwbats commentedon Nov 7, 2019
This issue may have made a comeback in .Net Core 3.
The following command creates no files in the specified output directory for me:
dotnet publish ..\..\ -c Debug -r win-x64 -o bin\Debug\PublishOutput[Update]
Never mind, looks like this explains it.
Fix a few bugs in CA1859.