I have created the new asp.net core web api project using dotnet8.
I wanted to use wwwroot as my web root path.
I added this line in my program.cs:
app.UseStaticFiles();
And I have tried to get that wwwroot path in my Service.cs, and I got null instead of path:
webHostEnvironment.WebRootPath
I also tried to add this line to my program.cs but result is stayed same:
builder.WebHost.UseStaticWebAssets().UseWebRoot("wwwroot");
I am know I can got that path like that but I want to use the right way and don’t use that customization.