EF6, Code-First, enable-migrations, "Unable to load the specified metadata resource"

I had a similar problem but with a different outcome. As it took too many hours to debug, here are some hints.

  1. The "Unable to load the specified metadata resource." error is related to your connection strings.
  2. Start by checking the connection string in your project where you have all your entities.
  3. Make sure the connection string is for a Code First approach and not the Model First or Database First approach (see below for example).
  4. Repeat these steps in all the projects within your solution where you have a connection string related to your DbContext.
  5. Then, retry the Enable-Migrations command and it should work properly.

Model first connection string example:

<add name="MyContext" 
    connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=MY_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" 
    providerName="System.Data.EntityClient" />

Code first connection string example:

<add name="MyContext" 
    connectionString="Data Source=.;Initial Catalog=MY_DB;Integrated Security=True;MultipleActiveResultSets=True" 
    providerName="System.Data.SqlClient"/>

  1. IF you have more than one project in the solution, be sure that in the Package manager console window you have selected the project with dbContext.
  2. Migrations use connectionString with name equals DbContext class. In your case it's OrganisationsContext, but isn't Leegz_Entities_Organisations.