I have created a fresh "ASP.NET Web Application (.NET Framework)", navigated to the folder in a console and ran
dotnet publish -o ..\..\..\..\..\..\tmp\publish -c Release
ordotnet publish -o C:\Users\[...]\tmp\publish -c Release
Both commands should produce identical results
The first command doesn't copy the wwwroot
and Views
folders in the output folder
.NET Command Line Tools (1.0.0-preview2-003121)
Product Information:
Version: 1.0.0-preview2-003121
Commit SHA-1 hash: 1e9d529bc5
Runtime Environment:
OS Name: Windows
OS Version: 10.0.10586
OS Platform: Windows
RID: win10-x64
I had the same issue. If I use dotnet publish -c release --output ".\publish"
- not work. If I use dotnet publish -c release --output publish
- work.
I'm seeing this too. This appears to be a breaking change in RTM vs RC2.
I am almost sure this is the line that causes it to not work -https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.ProjectModel/Files/IncludeFilesResolver.cs#L43
I think it should be removed or the path should be converted to absolute somewhere here:
https://github.com/dotnet/cli/blob/rel/1.0.0/src/dotnet/commands/dotnet-publish/PublishCommand.cs#L186
+1 to get this corrected. We're seeing the same issue.
:+1:
Find it slightly disturbing that such a fundamental bug has existed for so long, across multiple releases, and has no comment from any team members.
@markrendle Me too, especially because it's an RC2 to RTM regression which affects functionality.
Bitten by this
Bitten by this too. Absolute paths work luckily.
Just tried this scenario with preview3:
dotnet new -t Web
dotnet restore
dotnet publish
dotnet publish -o ../out
Both publish folders contain wwwroot.
Give it a shot [grab the latest bits from https://github.com/dotnet/cli to try it before we officially ship] and let us know if you find additional issues.
Yes, the relative paths work. Thanks!
Most helpful comment
I had the same issue. If I use
dotnet publish -c release --output ".\publish"
- not work. If I usedotnet publish -c release --output publish
- work.