Enabling Entity Framework Code First Migrations ProviderIncompatibleException

Quite simple actually … make sure the connection string in your config file is named the same as your context class OR make sure you do something like this public MyContextName : base(“connectionstringname”).

It’s also worth checking the name of the connection string being used in the configuration file for the start up project if your data context is in a class library as this is the connection string that will be used.


Connection Strings Tip

Really neat trick using MDAC (Microsoft Data Access Components) to create connection strings for various data types.

1. Create a new text file somewhere useful and rename it xxxx.udl

2. Double click on the file to open it.

3. Now your looking at the ‘Data Link Properties’ dialog box

4. Pick your connection details and click ok.

5. Open the file in a text editor (Notepad++!!!) and grab your complete connection string.