Web.config location tag stops working when deploying to server

Thank you very much in advance. When ASP.NET Development Server starts, everything works fine. However, when I deploy the asp.net application to the production server (IIS 7.0 integrated mode, new installation), my location tags in my web.config file are ignored.

Example: I use forms authentication, and when a user comes to my login.aspx page, external css and js files do not load ... although I indicated that these files should be accessible to all users (auth'd or not). However, as soon as the user logs in, the files are actually downloaded.

<authentication mode="Forms"> <forms loginUrl="~/Account/Login.aspx" timeout="2880" /> </authentication> <authorization> <deny users="?" /> <!-- Restrict anonymouse user access --> </authorization> 

And an exception for my css file ...

  <location path="Styles/xtools.css"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> 

I checked that the path to the css file is accurate. Any suggestions?

Thanks, -Dan

- EDIT Forgot to mention, I tried to create the web.config file in the target folder, and also ... still does not work.

+4
source share
1 answer

Just received. It is not enough to grant IIS_IUSRS permissions for folders containing the application ... I also needed to grant IUSR permissions.

The problem is resolved. Thank ben f

+2
source

Source: https://habr.com/ru/post/1345274/


All Articles