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.

publish command not copying wwwroot files on first run

See original GitHub issue

Steps to reproduce

  1. Clone project from github repo: https://github.com/ckuyehar/dotnet-mvc-bug
  2. dotnet restore
  3. dotnet publish

Expected behavior

The first time I run dotnet publish, I expected the assets folder to be copied to the published wwwroot folder.

Actual behavior

The first time I run dotnet publish, the published wwwroot folder (ie, bin\Debug\netcoreapp1.1\publish\wwwroot) is missing the assets folder .

After running dotnet publish for the first time, if you make changes to the file a.txt contained in the .\assets folder and run dotnet publish again the published wwwroot folder will always contain the latest changes made to the file a.txt.

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.3)

Product Information: Version: 1.0.3 Commit SHA-1 hash: 37224c9917

Runtime Environment: OS Name: Windows OS Version: 10.0.14393 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.3

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ckuyeharcommented, Apr 26, 2017

I was just informed that this was caused by my incorrect understanding of msbuild.

You may close.

0reactions
t0xicDencommented, Sep 13, 2017

Who still has similar issue try to read my comment

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some files in "wwwroot" folder are not published in ASP. ...
I solved the issue. The solution is to edit the .csproj file. Remove all the ItemGroup tags related to wwwroot and then add...
Read more >
Is there a way to include all web folders (ClientApp ...
I'm using this command to publish a single exe file: dotnet publish -r win-x64 -c release /p:PublishSingleFile=true /p:PublishTrimmed=true…
Read more >
dotnet publish command - .NET CLI
dotnet publish - Publishes the application and its dependencies to a folder for deployment to a hosting system. Synopsis .NET CLI Copy.
Read more >
Keeping Content Out of the Publish Folder for WebDeploy
I've run into issues with keeping files from publishing with WebDeploy on numerous occasions. When working with large projects it's not ...
Read more >
Host and deploy ASP.NET Core Blazor WebAssembly
Learn how to host and deploy Blazor WebAssembly using ASP.NET Core, Content Delivery Networks (CDN), file servers, and GitHub Pages.
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