I created a asp.net website and published it in iis 7. I deleted the default website option in the iis 7 and created the new website in the iis 7.
When i click the default document I got the error like "Error cannot add duplicate collection entry of type add with unique key attribute 'value' set to index.aspx". I used the following code in my web.config file.
IIS7 defines a defaultDocument section in its configuration files which can be found in the %WinDir%\System32\InetSrv\Config folder. Most likely, the file index.aspx is already defined as a default document in one of IIS7's configuration files and you are adding
it again in your web.config.
I suspect that removing the line<add
value="index.aspx" />
from the defaultDocument/files section will fix your issue.
The defaultDocument section of your config will look like:
<defaultDocument>
<files>
<remove value="default.aspx" />
<remove value="index.html" />
<remove value="iisstart.htm" />
<remove value="index.htm" />
<remove value="Default.asp" />
<remove value="Default.htm" />
</files>
</defaultDocument>
Note that index.aspx will still appear in the list of default documents for your site in the IIS manager.
For more information about IIS7 configuration, clickhere.
The ideal scenario is to have<add
value="default.aspx" />
in config so the application can be deployed to any server without having to reconfigure. IMHO I think the implementation within IIS is poor.
We've used the following to make our default document setup more robust and as a result more SEO friendly by using canonical URL's:
<configuration>
<system.webServer>
<defaultDocument>
<files>
<remove value="default.aspx" />
<add value="default.aspx" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Works OK for us.
分享到:
相关推荐
Polya is one of the most frequently quoted mathematicians, and the following statements from "How to Solve It" make clear why: "My method to overcome a difficulty is to go around it." "Geometry is ...
How to solve it Modern Huristics 2nd edition
How to solve it 清晰英文版
101 Project Management Problems and How to Solve Them
How To Solve Physics Problems How To Solve Physics Problems How To Solve Physics Problems
How to Solve It:A New Aspect of Mathematical Method
How to solve 90% of NLP problems_ a step-by-step guide
《如何解题,现代启发法》的英文版,DJVU 格式,可搜索。
how to solve it 怎样解题.
副标题: A New Aspect of Mathematical Method (Princeton Science Library) ISBN: 9780691119663 页数: 288 定价: USD 16.95 出版社: Princeton University Press 装帧: Paperback 出版年: 2004-04-05
This is a physics dubject,it teaches you how to solve the problems in physics
[方法论]Polya How to Solve It 2004 英文版
Solve big problem and test new ideas in just 5 days
how to solve it-some basic steps
How to Solve It_Modern Heuristics,启发式解决方法,欢迎下载
How to Solve Math Problems Using Symbolic Math Toolbox.zip
Collection of Matlab codes to solve typical CRE (Chemical Reaction Engineering) problems.zip
Collection of Matlab codes to solve typical CRE (Chemical Reaction Engineering) problems
Collection of Matlab codes to solve typical CRE (Chemical Reaction Engineering) problems