开发者

Web.config location tag stops working when deployed to Server

开发者 https://www.devze.com 2023-02-20 01:19 出处:网络
Many thanks in advance.When running the ASP.NET Development Server, everything is working fine.However, when I deploy my asp.net application to the production server (IIS 7.0 integrated mode, fresh in

Many thanks in advance. When running the ASP.NET Development Server, everything is working fine. However, when I deploy my asp.net application to the production server (IIS 7.0 integrated mode, fresh install), my location tags in my web.config file are being ignored.

Case in point: I'm using forms authentication, and when the user arrives at my login.aspx page, the external css & js files are not being loaded...even though I have specified that those files should be available to all users (auth'd or not). However, once the user is logged in, the files do in fact load.

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

And the exception to my css file...

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

I've verified that the path to the css file is accurate. Any suggestions?

Thanks, --Dan

--EDIT For开发者_运维问答got to mention, I have tried creating a web.config file in the targetted folder as well...still not working.


Just got it. It wasn't enough to give IIS_IUSRS permissions on the folders containing the app ...I needed to give IUSR permissions, as well.

Problem solved. Thanks, ben f!

0

精彩评论

暂无评论...
验证码 换一张
取 消