I had a class library project that used Entity Framework and it worked fine until I moved the model out to a separate class library type project.

After I moved the model out to a separate class library project called Model, I changed the connection string in the app/web.config to read as follows:

<add name="GlobalizationEntities" 
connectionString="metadata=res://Model.dll/Models.ResourceGlobalizationModel.csdl|
res://Model.dll/Models.ResourceGlobalizationModel.ssdl|
res://Model.dll/Models.ResourceGlobalizationModel.msl;
provider=System.Data.SqlClient;
provider connection string=&quot;
Data Source=MyComputer\sqlexpress;
Initial Catalog=DaDatabase;
Integrated Security=true;
MultipleActiveResultSets=True&quot;" 
providerName="System.Data.EntityClient" />

(I've included line breaks in the snippet above on purpose only for readability. My code does not have those line breaks.)

Now, my solution structure looks like this:

enter image description here

However, I get a FileNotFound exception at run-time that reads:

System.IO.FileNotFoundException was unhandled by user code
  HResult=-2147024894
  Message=Unable to resolve assembly 'Model.dll'.
  Source=System.Data.Entity
  StackTrace:
       at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.ResolveAssemblyName(String assemblyName, MetadataArtifactAssemblyResolver resolver)
       at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
       at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
       at
Edit
Report