我正在使用asp.net core 2.1,我在我的本地机器上启动应用程序没有任何问题,我可以调试它并在浏览器上打开它但是当我将它部署到服务器时,我得到了重写错误,我可以'登录
这是我的web.config文件:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="autoFormsAuthentication" value="false" />
<add key="enableSimpleMembership" value="false" />
</appSettings>
<location path="." inheritInChildApplications="false" allowOverride="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\BusinessAdvisor.Inventory.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
<system.web>
<trust level="Full" />
</system.web>
</location>
<system.web>
<authentication mode="None" />
<compilation defaultLanguage="c#" debug="true" />
</system.web>
<connectionStrings>
<add name="DefaultConnection" connectionString="server=localhost;user id=????_dba;password=???????;database=atechdzc_mobiserv;allowuservariables=True;persistsecurityinfo=True;SslMode=none" />
</connectionStrings>
</configuration>
<!--ProjectGuid: 5d471955-9737-4896-a960-3eb7ede4494e-->
我尝试了所有解决方案,但我得到了同样的错误!
编辑:
当我对“Windows身份验证”进行身份验证时,不会出现错误,如果我将其设置为“匿名身份验证”,则错误仍然存在。
我的连接字符串出错,然后迁移没有自动更新更改。我修复了appsettings.production.json上的连接字符串,并更新了数据库。