I have exactly the same configuration in app.config files in two projects in different solutions.
One is an old solution where I deleted the old migrations, changed the DB and started getting connection errors with the new DB.
I reinstalled EF, deleted migrations, re-enabled them etc. Nothing works.
I created a new solution, installed EF, copied my model classes into it and tried the same. It works! The migration codes generated are exactly the same.
So the same configuration for the same code are in two different solutions on the same computer. One gets the below error while the other one works.
System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
It's not the same error with the other question mentioned in the comments. Different exceptions.
Edit: I copy the project files and add it to a brand new solution. And it works! I restarted the old solution, restarted my computer, reinstalled all packages in the project. Nothing works. I really need to make it work on that solution.
User contributions licensed under CC BY-SA 3.0