I get an EntityException when moving an application in IIS 7

I created an application with asp.net mvc using the framework 4 entity and SQL Server 2008. Everything works fine on localhost, but when I go to iis I get this exception:

Cannot open database "Template" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\DefaultAppPool'.
+3
source share
1 answer

You can either update the connection string to explicitly have a valid username and password to log into your SQL server, or you can change the identifier that works in the DefaultAppPool program inside IIS.

For the first, you need to create a SQL Server login with sufficient access to your target database.

For the second, you should go to IIS => Application Pools => Default Application Pool => Set Properties => Process Model => Change the identifier in LocalSystem or your user input.

+3
source

Source: https://habr.com/ru/post/1773409/


All Articles