[英]What can cause my iis to not allow browsing directory?
我试图建立和实体frameWork,它们将使用sql-server 2008以代码优先的方式来使数据库变态....因此,我只是从创建2个包含一些测试特性的类开始...(使用asp.net):
制作班级文章:
public class Articles
{
public int ID { get; set; }
public string desc{ get; set; }
public decimal price { get; set; }
public Articles()
{
}
}
使类商店:
public class Stores
{
int ID { get; set; }
String Name { get; set; }
List<Articles> Elements { get; set; }
public Stores()
{
}
}
进一步制作Context类:
public class dbSroreContext : DbContext
{
public DbSet<Stores> Stores { get; set; }
public DbSet<Articles> Articles { get; set; }
public dbSroreContext()
{
}
}
好的,然后我将连接字符串放入我的web.config文件中:
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<connectionStrings>
<add connectionString="Server.;"
name="dbSroreContext"
providerName="System.Data.SqlClient"
/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>
到目前为止,我正在尝试在IIS中启用目录浏览器,但没有结果..
Error : The Web server is configured to not list the contents of this directory.
Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
好吧,总的来说,我有最好的解决方案,我想! 我的PC上有多台服务器...这与服务器混乱使能了浏览目录! 因此,我能做的最好的事情就是从网站级别启用它:
<system.webServer>
<directoryBrowse enabled="true"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
将此添加到web.config文件中,应该没问题! 我希望它可以对其他帮助的人有所帮助! :D
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.