Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a wwwroot directory to my WebAPI project in Visual Studio 2019

I am under the impression that the wwwroot directory is not just a normal folder. How do I add it to my project in Visual Studio 2019?

I have added the following to my Configure method in my Startup.cs file:

app.UseDefaultFiles();
app.UseStaticFiles();

Now I just need to add the wwwroot directory itself. My solution

I am trying to do it for step 2 in the following tutorial: https://learn.microsoft.com/en-gb/aspnet/core/tutorials/web-api-javascript?view=aspnetcore-3.0

What is a wwwroot directory? Just a normal folder or something else?

like image 610
CodingStudent Avatar asked Feb 02 '26 12:02

CodingStudent


2 Answers

Just add a normal folder and call it wwwroot. That´s it.

like image 59
JakobFerdinand Avatar answered Feb 04 '26 01:02

JakobFerdinand


Add a new folder to the project and name it "wwwroot" the folder icon will automatically change.

like image 24
CodingStudent Avatar answered Feb 04 '26 00:02

CodingStudent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!