开发者

When publishing a web site, my default document name keeps getting removed from IIS

开发者 https://www.devze.com 2023-01-23 16:52 出处:网络
I have an ASP.NET web site project, which I\'m publishing to IIS on my Win2k8 R2 server.It has a default page called login.aspx.I set that up on the published web site.

I have an ASP.NET web site project, which I'm publishing to IIS on my Win2k8 R2 server. It has a default page called login.aspx. I set that up on the published web site.

Trouble is, every time I publish a new version of the web site, the login.aspx entry gets erased from the "Default Document" settings of the web site in IIS. Thi开发者_JAVA百科s is very annoying. How can I publish my web site from Visual Studio without wiping out the default page every time?


Try putting a defaultDocument in your site's web.config:

<system.webServer>
    <!-- your other stuff -->

    <defaultDocument enabled="true">   
       <files>      
           <clear/>                 
           <add value="login.aspx"/>  
       </files>
    </defaultDocument>

</system.webServer>


You are probably using "sub site", and the default document list of the root website is blank.

Try adding default document (even dummy) to the root website and see if it helps.

(Taken from here: http://forums.iis.net/t/1169880.aspx)


when the login.aspx is added to subsite. it's type 'local'. it gives this error. you should add this page to the servere itself. click the server and then choose the feature view--> iis--- default document then right click to add your "login.aspx" page.

now you should see this in default document of all your sub sites and it will not be erased in publish or server restart.

this is my personal exceperience

Omar kamel

0

精彩评论

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