发布网站时,我的默认文档名称将一直从IIS中删除

时间:2023-01-22 22:45:01

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.

我有一个ASP.NET网站项目,我将在我的Win2k8 R2服务器上发布到IIS。它有一个名为login.aspx的默认页面。我在已发布的网站上进行了设置。

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. This is very annoying. How can I publish my web site from Visual Studio without wiping out the default page every time?

麻烦的是,每次我发布新版本的网站时,login.aspx条目都会从IIS网站的“默认文档”设置中删除。这非常烦人。如何在不删除默认页面的情况下从Visual Studio发布我的网站?

3 个解决方案

#1


3  

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)

(摘自:http://forums.iis.net/t/1169880.aspx)

#2


16  

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

尝试将defaultDocument放在站点的web.config中:

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

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

</system.webServer>

#3


0  

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.

将login.aspx添加到子网站时。它的类型是“本地的”。它给出了这个错误。你应该把这个页面添加到servere本身。单击服务器,然后选择功能视图 - > iis ---默认文档,然后右键单击以添加“login.aspx”页面。

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

#1


3  

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)

(摘自:http://forums.iis.net/t/1169880.aspx)

#2


16  

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

尝试将defaultDocument放在站点的web.config中:

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

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

</system.webServer>

#3


0  

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.

将login.aspx添加到子网站时。它的类型是“本地的”。它给出了这个错误。你应该把这个页面添加到servere本身。单击服务器,然后选择功能视图 - > iis ---默认文档,然后右键单击以添加“login.aspx”页面。

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