发布到Azure后无法使MVC站点正常工作?
我在本地有一个完美工作的MVC项目,但在我通过下载Azure发布配置文件、导入并发布将其发布到Azure之后,每当我在上传的站点上执行需要与数据库联系的操作时,我只会得到一个标准错误屏幕。比如登录或搜索网站上的其他资料 它只是给了我一个简单的错误已经发生的消息,没有详细说明什么是错误的?我尝试在服务器上启用详细的错误消息,但它并不关心它只是给出相同的错误消息,没有任何解释 我尝试了通过搜索引擎找到的各种东西。但我不能指出我的问题。我怀疑这与服务器上的web配置文件有关?但我不能肯定 更新:事实上,我现在发布的是具体的问题,而不是一般的消息,似乎出于某种原因,在使用identity框架时创建的普通表没有创建?这对我来说很奇怪?我的意思是,我确实将我拥有的两个不同的dbcontext类合并到了标准的ApplicationDbContext类中,但在本地它仍然存储了所有用户等。为什么在我发布它时它不再创建这些表发布到Azure后无法使MVC站点正常工作?,azure,asp.net-mvc-5,publish,Azure,Asp.net Mvc 5,Publish,我在本地有一个完美工作的MVC项目,但在我通过下载Azure发布配置文件、导入并发布将其发布到Azure之后,每当我在上传的站点上执行需要与数据库联系的操作时,我只会得到一个标准错误屏幕。比如登录或搜索网站上的其他资料 它只是给了我一个简单的错误已经发生的消息,没有详细说明什么是错误的?我尝试在服务器上启用详细的错误消息,但它并不关心它只是给出相同的错误消息,没有任何解释 我尝试了通过搜索引擎找到的各种东西。但我不能指出我的问题。我怀疑这与服务器上的web配置文件有关?但我不能肯定 更新:事实上
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=301880
-->
<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=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<system.diagnostics>
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=2.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<connectionStrings>
// REMOVED SENSITIVE INFO
</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>
<modules>
<remove name="FormsAuthenticationModule" />
</modules>
<staticContent>
<remove fileExtension=".svg" />
<remove fileExtension=".eot" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".woff" mimeType="application/x-woff" />
</staticContent>
</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="0.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>
<contexts>
<context type="MEV3.Models.ApplicationDbContext, MEV3">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[MEV3.Models.ApplicationDbContext, MEV3], [MEV3.Migrations.Configuration, MEV3]], EntityFramework, PublicKeyToken=b77a5c561934e089">
<parameters>
<parameter value="DefaultConnection_DatabasePublish" />
</parameters>
</databaseInitializer>
</context>
</contexts>
</entityFramework>
</configuration>
这个答案和问题中选择的答案下面的答案-结合起来-救了我的后腿,使一切顺利进行!非常感谢我偶然发现了这一点
尝试在web.config文件中将customErrors设置为off:。您应该能够查看有关应用程序部署到Azure时失败原因的详细错误。很可能是缺少DLL或数据库连接字符串不正确。我尝试过了,现在当我尝试访问该网站时,我得到了一个空白的白色页面,上面有此文本。。。由于发生内部服务器错误,无法显示该页面。您是否可以在此处共享指向您网站的链接?如果详细错误消息设置为“开”,您可以签入web.config:确保链接在这里,数据库中除了自动种子管理用户外,没有其他内容。