How to fix No webpage was found for the web address

Ashwath S 0 Reputation points
2024-08-10T16:36:34.97+00:00

Created a new App service, and to test the web app, manually uploaded a image under WWWROOT directory in app service editor and the uploaded image was accessible through url "https://domainname/image.png" but on publishing a .net core application the above url throws page not found error but the controller functionality in the .net core works fine as expected, how to fix this I want to access all the static files under WWWROOT to be accessible using the url domainname/documentnamen, tried many ways like
adding app.UseStaticFiles(); in program.cs
can anyone help me on how to fix the above issue?

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,553 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 65,131 Reputation points
    2024-08-13T19:19:42.17+00:00

    the static file middleware allows returning static files. this middleware must come before razor page and mvc. so us your program.cs

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.