I\'m getting the following error when running our ASP.NET Web API project on our production server.
403 - Forbidden: Access is denied. You do not hav
We missed deployment configuration, application pool associated with the application not exists. I created an application pool with the same name and this error has gone away.
In my case, someone deleted default Asp Net MVC Home/Index route in RouteConfig.
After placing this code back to the RouteConfig.cs in RegisterRoutes method the problem was gone.
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
The above error will pop up when you do not have the permission to access the folder/web.config file.
Try the following
I think it should work .
I recently faced same issue while configuring my site on iis (https). In my case, tried several solutions like:
and several hit and try and at last I found!!!!
It was very tiny problem I choose "Precompile during publishing" while publishing my website/APIs and when i unchecked this option everything become normal and start working fine, not sure actual reason why this happen but to resolve you may try as showing in picture (visual studio 2019) below:
You can follow this approach while deploying the application to production environment.
Hopefully it should run.
In case it helps anyone my issue was my publish options set to "Allow precompiled site to be updatable" and I was missing the file "PrecompiledApp.config" in my deployed API.