2

I have fresh .Net core web app and it's source code uploaded first time on production server with CICD of the same. It went successfully but when I run the web app, the UI and js files were missing. After much digging in, I found that bower_component folder is missing which includes necessary css and js files from wwwroot folder.

Can anybody tell me why it is not uploading bower_components to the wwwroot folder?

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56
Krunal
  • 53
  • 6
  • If my solution helps you, could you please mark my answer as [accepted](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), tks~ – Jason Pan Nov 25 '20 at 05:24
  • Aside, you mention that this is a fresh ASP.NET Core web application, but also that it's using Bower. You should know that [Bower is deprecated](https://bower.io/blog/2017/how-to-migrate-away-from-bower/). You should instead prefer using e.g. Yarn with WebPack. – Jeremy Caney Nov 27 '20 at 21:16

1 Answers1

0

You need to modify your .csproj file to include bower_component folder.

You can read offical document first(Include files at publish time), then you can refer below posts.

Related posts(include files, not folder) can refer to:

1. Unable to find files located in my root project folder when hosted on Azure

2. .NET Core include folder in publish

3. How to copy a folder to output directory and keep its root folder? #2949

4. dotnet core publish: include/exclude dir in output

Jason Pan
  • 15,263
  • 1
  • 14
  • 29