用户 'IIS APPPOOL\***' 登录失败

在vs调试一切正常,发布到ii后出现错误!

1.查看项目web.config文件中的数据库连接字符串:Integrated Security=True;

2.打开iis,查看应用程序池,使用了集成验证模式,其标识为ApplicationPoolIdentity,导致了连接数据库出错

解决方法

1.修改SQLServer的连接字符串,使用数据库帐号密码登录

<add connectionString="Server=.;Database=xxx;UserID=sa;Password=xxx" name="DefaultConnection" providerName="System.Data.SqlClient" />

在运行网站正常了

猜你喜欢

转载自blog.csdn.net/qq_42335551/article/details/82809526