I used EntityFramework 6.0 in one solution which included multiple projects such as WebSite level project, DataAccess level project. In my solution, the migrations should be happened in DataAccess level project.
When I run Add-Migration command in Package Manager Console, raised "Unable to load the specified metadata resource".
Finally, I found I set the WebSite level project as "Startup" project and this trigger above exception. It seems system will auto checking the connection string settings in the StartUp project first. And my data connection string set in WebSite level project is
"metadata=res:///ApplicationEntities.csdl|res:///ApplicationEntities.ssdl|res://*/ApplicationEntities.msl;provider=System.Data.SqlClient;provider connection string="data source=.;initial catalog=YourDatabaseName;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework""
which is not correct for code first.
The correct connection string should be:
"Data Source=.;Initial Catalog=YourDatabaseName;Integrated Security=True"
Conclusion, always check the "connectionStrings" section in web.config in the "StartUp" project of solution first.