I published ASP.NET MVC Core 1.1.1 project to production along with its SQL Server 2012 db. After a few days, I backed up and restored the db from production server to development machine and reconnected it to my VS2017 development project. But when I try to run the app it gives me the following error:
A database operation failed while processing the request. InvalidOperationException: An exception has been raised that is likely due to a transient failure. If you are connecting to a SQL Azure database consider using SqlAzureExecutionStrategy. SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) Win32Exception: No process is on the other end of the pipe I checked the same db login by connecting with this same login to SSMS and it successfully connects to the db.
Moreover, below the above error message, there is following message with the list of all migrations the project has:
Applying existing migrations for MyProjectContext may resolve this issue There are migrations for MyProjectContext that have not been applied to the database 20161209232754_myFirstMigration 20170121191004_mySecondMigration 20170303172256_myThirdMigration 20170303172256_myFourthMigration In Visual Studio, you can use the Package Manager Console to apply pending migrations to the database: PM> Update-Database Alternatively, you can apply pending migrations from a command prompt at your project directory: > dotnet ef database update NOTE:
- Development machine is
Windows 10, Production sever isWindows Server 2012-R2. Both the machines have same editions ofSQL Server 2012. - I've verified that both the
VS2017project and the Db have exact same migrations on the local development machine. After deployment to production the migrations were never changed on development machine. And when I run the recommended commandPM> Update-Database -context MyProjectContextfrom the error message above, I get the error:CREATE DATABASE permission denied in database 'master'.