Deploy ASP.NET MVC Entity Framework web application with database

0

I have a working ASP.NET MVC web app I developed with Entity Framework with a database-first approach. The database was already existing. When I run it in Visual Studio, everything works fine.

I then published the site and setup an IIS web site on my computer for it. Pages that do not require data work fine. But the site cannot access the database. I have tried creating a mixed mode SQL Server id, changing the odbc connection to login as the admin user, and adding the IUSR user to SQL Server. No luck.

How can I get the local site to access the database from IIS just like it does through IIS Express?

Here is the error page:

Server Error in '/' Application.

Cannot open database "PVS" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\PVS'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Cannot open database "PVS" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\PVS'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Cannot open database "PVS" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\PVS'.]

sql-server
asp.net-mvc
entity-framework
iis
asked on Stack Overflow Oct 5, 2018 by Jerry Welliver • edited Oct 5, 2018 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0