This exception occurs when the project cannot use the connection string to locate the 3 parts of EDMX: csdl, msl, and ssdl.
- Find the right configuration file. Review the configuration file of the executing assembly. For example, if you are running a unit test project which references another project with edmx, you should look at the unit test project’s app.config file. You should add an app.config file to your unit test project if necessary.
- Verify that your executing project (i.e. unit test project) references an assembly containing the 3 parts of EDMX. This is especially true if you are doing POCO. It is the project that you added the item “ADO.NET Entity Data Model”. To verify, use a 3rd party tool (e.g. ILSpy) to examine the assembly inside; you should see the resources containing the 3 parts of EDMX. Note: Your project may compile fine without it, but you need it at run time.
- Make sure you have a reference to the entity framework dll.
- Try different ways of configuring the connection string:
- The standard/default connection is probably not working for you or else you won’t be reading this.
- The safest way is to specify the fully qualified assembly name of your EMDX project in your connection string.
- The last resort is use an asterisk. This may get you past the error “unable to load the specified meta resource.” However, you may get some other error “The entity type is not part of the model for the current context” when you access the entity object within the model.
If you have the edmx in one project and the xxxx.Context.tt in another project, then you probably need to use approach A for your unit testing project’s connection string to point to the project with .edmx file.
If you have both edmx and xxxx.Context.tt in the same project, then your unit testing project’s default connection string should work.