Asp.net mvc 4 500错误代码内部服务器错误
我最近在一个webhost服务器上托管了一个asp.net mvc4网站,在部署之前,一切正常,包括远程数据库连接,但在将发布的文件移动到托管服务器后,我无法远程浏览该网站。我收到一个500-内部服务器错误(您正在查找的资源有问题,无法显示)。我已查看了web.config文件,但找不到任何内容。联系我的主机提供商后,我被要求添加Asp.net mvc 4 500错误代码内部服务器错误,asp.net-mvc-4,Asp.net Mvc 4,我最近在一个webhost服务器上托管了一个asp.net mvc4网站,在部署之前,一切正常,包括远程数据库连接,但在将发布的文件移动到托管服务器后,我无法远程浏览该网站。我收到一个500-内部服务器错误(您正在查找的资源有问题,无法显示)。我已查看了web.config文件,但找不到任何内容。联系我的主机提供商后,我被要求添加 <modules runAllManagedModulesForAllRequests="true"/>, , 我这样做了,但仍然得到相同的
<modules runAllManagedModulesForAllRequests="true"/>,
,
我这样做了,但仍然得到相同的错误。伙计们,我需要你们的帮助,谢谢
下面是我的web.config xml文件的代码片段
<?xml version="1.0" encoding="utf-8"?>
<!--
-->
<configuration>
<configSections>
<section name="entityFramework"
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
<add name="MyConnectionString" connectionString="Data Source=mssql.mydomain.com,port;initial catalog=MyDB;persist security info=True;user id=UserID;password=Password;MultipleActiveResultSets=True;App=EntityFramework"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<system.web>
<authentication mode="None" />
<compilation targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.webServer>
<customErrors mode="Off"/>
<modules runAllManagedModulesForAllRequests="true"/>
</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-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
将此项设置为on,您将看到显示的实际错误,以便调试错误@danm谢谢你的建议……实际上我必须重新发布这个应用程序,现在它工作正常了