繁体   English   中英

发布后的内部服务器错误和未创建的表

[英]Internal Server Error after publishing and Tables not being created

此问题仅出现在我发布的服务器上。 在当地,我没有问题。

从VS2017发布后,该网页显示内部服务器错误,该页面上没有进一步说明。 这不是我第一次发表,所以这个问题非常随意。

我在我的智慧结束,我完全被这导致了什么。 特别是在我发布之前,它工作正常。 虽然,自从我从VS发表以来已经有一段时间了。

我试过的事情:

  • 重新启动服务器
  • 修复IIS并确保安装正确的.net核心版本。
  • 更多服务器重启
  • 确保存在正确的DLL(即使这不是第一次发布)
  • 检查appsettings中的连接字符串
  • 查看stdoutLog输出
  • 查看事件日志 - 这没有显示任何有用的信息

stdoutLog堆栈跟踪如下:

info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
      User profile not available. Using 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\AutoGenKeys\S-1-5-82-1102471511-930544150-2645822985-2987586966-3557056008\DataProtection' as key repository and Windows DPAPI to encrypt keys at rest.
Application startup exception: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: providerInvariantName
   at Serenity.Data.DbProviderFactories.GetFactory(String providerInvariantName)
   at Serenity.Data.SqlConnections.GetFactory(String providerName)
   at Serenity.Data.ConnectionStringInfo.get_ProviderFactory()
   at ApexCore.DataMigrations.EnsureDatabase(String databaseKey) in DataMigrations.cs:line 40
   at ApexCore.DataMigrations.Initialize() in DataMigrations.cs:line 27
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.Internal.AutoRequestServicesStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder builder)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
crit: Microsoft.AspNetCore.Hosting.Internal.WebHost[6]
      Application startup exception

正如您所看到的,它表示DataMigrations.cs中存在错误。 这并不完全有意义,因为在那里有很长一段时间没有变化。 抛出错误的区域超出了创建数据库表的位置。 因此,由于表不存在,因此迁移失败是有意义的。

所以,总结一下......网站将在最新发布后加载。 不在数据库中创建表,因为它们应该是。 连接字符串是正确的,没有出现错误,说它无法连接。

我想要提到的一件事是,当在Connection Strings下查看IIS管理器时,我注意到它已经没有任何东西了。 这个假设是不是在我的AppSettings自动填充了什么?

您可以通过在程序和功能中修复iis服务器来解决此问题。
请阅读这个答案。 它可能会帮助你
指定的参数超出了有效值的范围。 参数名称:site

经过多次崩溃后,当我发布发布模式时,网站无法运行。 但如果我在调试模式下发布,一切都很好。 这是一个临时解决方案,但它现在必须要做。 我将不得不研究为什么发布模式被破坏了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM