question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet publish with relative path not respecting PublishOptions Include

See original GitHub issue

Steps to reproduce

In an asp.net project add directories into the PublishOptions Include setting in the project.json. e.g. "publishOptions": { "include": [ "wwwroot", "app", "Views", "appsettings.json", "web.config" ] },

Then publish using donet CLI. e.g. dotnet publish --framework net46 --output "..\..\..\someRelativeDir" --configuration Debug

Expected behavior

The includes folders are copied across to the publish directory. The expected output is the same as running the command with a full path. e.g. dotnet publish --framework net46 --output "c:\temp\myFullPathDir" --configuration Debug

Actual behavior

The directories specified in the publishOptions includes are not copied.

Environment data

dotnet --info output:

.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: 6.3.9600 OS Platform: Windows RID: win81-x64

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:17
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
adlordycommented, Dec 27, 2016

I have another reproduction scenario.

This does not work (wwwroot is not included): dotnet publish -c Release -o .\.out But this works: dotnet publish -c Release -o .out

.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.14393
 OS Platform: Windows
 RID:         win10-x64
1reaction
TheRealPiotrPcommented, Nov 12, 2016

Yep, MSBuild has a much stronger globbing functionality. I’m unable to repro this in preview3. Please re-open if you still see this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet publish with relative path not respecting ...
In an asp.net project add directories into the PublishOptions Include setting in the project.json. e.g. "publishOptions": { "include": [ " ...
Read more >
dotnet publish command - .NET CLI
To make publish output go to separate folders for each project, specify a relative path by using the msbuild PublishDir property instead of...
Read more >
dotnet publish-iis looking for web.config in wrong place
This seems to be a bug where a dotnet command resolves a relative path ... adding web.config in include -> publishOptions from project.json:...
Read more >
NETSDK1152: Found multiple publish output files with the ...
1. dotnet new console dotnet add package RavenDB.Client dotnet add package RavenDB.TestDriver dotnet build dotnet publish.
Read more >
Found multiple publish output files with the same relative ...
NET 6 to stop duplicate files being included in publish artifacts. So how do we get around it, well it turns out it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found