Asp.net mvc 4 ASP.NET MVC4提供配置为不列出此目录内容的错误

Asp.net mvc 4 ASP.NET MVC4提供配置为不列出此目录内容的错误,asp.net-mvc-4,iis,webdeploy,Asp.net Mvc 4,Iis,Webdeploy,我对此束手无策。我有一个ASP.NET MVC4 web应用程序。我正在尝试在Windows7Ultimate 64位机器上设置它。到目前为止,我已经安装了IIS(7.5版),通过Visual Studio生成的.zip文件安装了我的web应用程序,并安装了ASP.NET MVC 4。我已将我的网页指向.NET4应用程序池。但是,每次我尝试访问该页面时,都会出现以下错误: 我尝试在命令提示符下运行以下命令,因为它在过去为我解决了问题(从): 然而,它似乎什么也没做——它只是列出了所有的命令行选

我对此束手无策。我有一个ASP.NET MVC4 web应用程序。我正在尝试在Windows7Ultimate 64位机器上设置它。到目前为止,我已经安装了IIS(7.5版),通过Visual Studio生成的.zip文件安装了我的web应用程序,并安装了ASP.NET MVC 4。我已将我的网页指向.NET4应用程序池。但是,每次我尝试访问该页面时,都会出现以下错误:

我尝试在命令提示符下运行以下命令,因为它在过去为我解决了问题(从):

然而,它似乎什么也没做——它只是列出了所有的命令行选项。 我注意到,在已安装的应用程序列表中,它缺少Microsoft ASP.NET MVC 4运行时(这在我的另一台机器上)。有必要这样做吗?如果是,如何安装?运行ASP.NET MVC4安装程序不会添加它。 这是我在Windows功能中启用的功能: 有人能帮我指出正确的方向吗?谢谢我已经附上了我的web.config,但我认为问题更多的是如何让ASP.NET MVC4正常工作

              <configuration>
            <configSections>
            <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
            <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
            <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
            </sectionGroup>
            </configSections>
            <connectionStrings>
            <add name="ConnectDataContextConnectionString" connectionString="User Id=connectadmin;Password=letme1n;Host=ws2012e;Database=cl_svhstest;Persist Security Info=True;Found Rows=true;" />
            <add name="DBKey" connectionString="Driver={MySQL ODBC 3.51 Driver};User Id=connectadmin;Password=letme1n;Server=ws2012e;Database=cl_svhstest;Option = 3;Persist Security Info=True;Found Rows=true;" />
            <add name="ClTeleceteraDataContextConnectionString" connectionString="User Id=sa;Password=letme1n;Host=ws2012e;Database=cl_telecetera;Persist Security Info=True" />
            <add name="DefaultConnection" connectionString="DefaultConnection_ConnectionString" providerName="System.Data.SqlClient" />
            </connectionStrings>
            <appSettings>
            <add key="webpages:Version" value="2.0.0.0" />
            <add key="webpages:Enabled" value="true" />
            <add key="PreserveLoginUrl" value="true" />
            <add key="ClientValidationEnabled" value="true" />
            <add key="UnobtrusiveJavaScriptEnabled" value="true" />
            <add key="dhx_license" value="dan@telecetera.co.uk-enterprise--aHEjuRAwNm9yY7e7q4uR8P08+A1oBBK/aVgjzekJJdXuvReGeoKI+s3A0CcdEC0tXutD7y4okCfkA8OsRGdIww==" />
            <add key="elmah.mvc.disableHandler" value="false" />
            <add key="elmah.mvc.disableHandleErrorFilter" value="false" />
            <add key="elmah.mvc.requiresAuthentication" value="false" />
            <add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
            <add key="elmah.mvc.allowedRoles" value="*" />
            <add key="elmah.mvc.allowedUsers" value="*" />
            <add key="elmah.mvc.route" value="elmah" />
            </appSettings>
            <location path="">
            <system.web>
            <authorization>
            <deny users="?" />
            </authorization>
            </system.web>
            </location>
            <location path="api">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <location path="content">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <location path="scripts">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <system.web>
            <trust level="Full" />
            <roleManager enabled="true" />
            <customErrors mode="Off" />
            <compilation targetFramework="4.0" />
            <authentication mode="Forms">
            <forms loginUrl="~/Login/Index" defaultUrl="~/Login/Index" timeout="10080" />
            </authentication>
            <pages controlRenderingCompatibilityVersion="4.0">
            <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Optimization" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages" />
            </namespaces>
            </pages>
            <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
            </httpModules>
            <httpRuntime maxQueryStringLength="32768" maxRequestLength="1048576" executionTimeout="3600" />
            </system.web>
            <system.webServer>
            <modules runAllManagedModulesForAllRequests="true">
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
            </modules>
            <security>
            <requestFiltering>
            <requestLimits maxAllowedContentLength="1073741824" maxQueryString="32768" />
            </requestFiltering>
            </security>
            <httpErrors errorMode="Detailed" />
            <asp scriptErrorSentToBrowser="true" />
            <validation validateIntegratedModeConfiguration="false" />
            </system.webServer>
            <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.0.66.0" newVersion="1.0.66.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            </assemblyBinding>
            </runtime>
            <entityFramework>
            <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
            </entityFramework>
            </configuration>

通过卸载IIS,再次运行.NET framework 4.5安装程序(选择修复模式),然后重新安装IIS,我终于让它工作了。然后,当我添加我的应用程序时,它工作了。我在这上面浪费了几个小时,希望这能帮助别人

通过卸载IIS,再次运行.NET framework 4.5安装程序(选择修复模式),然后重新安装IIS,我终于让它工作了。然后,当我添加我的应用程序时,它工作了。我在这上面浪费了几个小时,希望这能帮助别人

              <configuration>
            <configSections>
            <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
            <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
            <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
            </sectionGroup>
            </configSections>
            <connectionStrings>
            <add name="ConnectDataContextConnectionString" connectionString="User Id=connectadmin;Password=letme1n;Host=ws2012e;Database=cl_svhstest;Persist Security Info=True;Found Rows=true;" />
            <add name="DBKey" connectionString="Driver={MySQL ODBC 3.51 Driver};User Id=connectadmin;Password=letme1n;Server=ws2012e;Database=cl_svhstest;Option = 3;Persist Security Info=True;Found Rows=true;" />
            <add name="ClTeleceteraDataContextConnectionString" connectionString="User Id=sa;Password=letme1n;Host=ws2012e;Database=cl_telecetera;Persist Security Info=True" />
            <add name="DefaultConnection" connectionString="DefaultConnection_ConnectionString" providerName="System.Data.SqlClient" />
            </connectionStrings>
            <appSettings>
            <add key="webpages:Version" value="2.0.0.0" />
            <add key="webpages:Enabled" value="true" />
            <add key="PreserveLoginUrl" value="true" />
            <add key="ClientValidationEnabled" value="true" />
            <add key="UnobtrusiveJavaScriptEnabled" value="true" />
            <add key="dhx_license" value="dan@telecetera.co.uk-enterprise--aHEjuRAwNm9yY7e7q4uR8P08+A1oBBK/aVgjzekJJdXuvReGeoKI+s3A0CcdEC0tXutD7y4okCfkA8OsRGdIww==" />
            <add key="elmah.mvc.disableHandler" value="false" />
            <add key="elmah.mvc.disableHandleErrorFilter" value="false" />
            <add key="elmah.mvc.requiresAuthentication" value="false" />
            <add key="elmah.mvc.IgnoreDefaultRoute" value="false" />
            <add key="elmah.mvc.allowedRoles" value="*" />
            <add key="elmah.mvc.allowedUsers" value="*" />
            <add key="elmah.mvc.route" value="elmah" />
            </appSettings>
            <location path="">
            <system.web>
            <authorization>
            <deny users="?" />
            </authorization>
            </system.web>
            </location>
            <location path="api">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <location path="content">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <location path="scripts">
            <system.web>
            <authorization>
            <allow users="*" />
            </authorization>
            </system.web>
            </location>
            <system.web>
            <trust level="Full" />
            <roleManager enabled="true" />
            <customErrors mode="Off" />
            <compilation targetFramework="4.0" />
            <authentication mode="Forms">
            <forms loginUrl="~/Login/Index" defaultUrl="~/Login/Index" timeout="10080" />
            </authentication>
            <pages controlRenderingCompatibilityVersion="4.0">
            <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Optimization" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages" />
            </namespaces>
            </pages>
            <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
            </httpModules>
            <httpRuntime maxQueryStringLength="32768" maxRequestLength="1048576" executionTimeout="3600" />
            </system.web>
            <system.webServer>
            <modules runAllManagedModulesForAllRequests="true">
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
            </modules>
            <security>
            <requestFiltering>
            <requestLimits maxAllowedContentLength="1073741824" maxQueryString="32768" />
            </requestFiltering>
            </security>
            <httpErrors errorMode="Detailed" />
            <asp scriptErrorSentToBrowser="true" />
            <validation validateIntegratedModeConfiguration="false" />
            </system.webServer>
            <runtime>
            <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
            <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-1.0.66.0" newVersion="1.0.66.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.1" newVersion="4.0.0.1" />
            </dependentAssembly>
            <dependentAssembly>
            <assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
            </dependentAssembly>
            </assemblyBinding>
            </runtime>
            <entityFramework>
            <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
            </entityFramework>
            </configuration>