title: MetadataException when using Entity Framework Entity Connection
body: <p>This code:</p>
  
  <pre><code>using (EntityConnection conn = new EntityConnection("name=ELSCommonEntities"))
  {
    conn.Open();
  }
  </code></pre>
  
  <p>Gives me the following error:</p>
  
  <pre class="lang-none prettyprint-override"><code>Test method ELS.Service.Business.IntegrationTest.Base.ServiceBaseIntegrationTest.StartLoggingTestMethod threw exception:  System.Data.MetadataException: Unable to load the specified metadata resource..
  </code></pre>
  
  <p>With the following stack trace:</p>
  
  <pre class="lang-none prettyprint-override"><code>System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
  System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
  System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
  System.Data.EntityClient.EntityConnection.SplitPaths(String paths)
  System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
  System.Data.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure)
  System.Data.EntityClient.EntityConnection.Open()
  ELS.Service.Business.Base.ServiceBase.StartLogging(String userWindowsLogon) in C:\C-TOM\ELS-RELEASE1\ELS.Service.Business\Base\ServiceBase.cs: line 98
  ELS.Service.Business.IntegrationTest.Base.ServiceBaseIntegrationTest.StartLoggingTestMethod() in C:\C-TOM\ELS-RELEASE1\ELS.Service.Business.IntegrationTest\Base\ServiceBaseIntegrationTest.cs: line 65
  </code></pre>
  
  <p>However, this code which uses the same connection string:</p>
  
  <pre><code>using (ELSCommonEntities db = new ELSCommonEntities())
  {
      var res = from c in db.Logging
                select c;
  
      int i = res.Count();
  }
  </code></pre>
  
  <p>Does not give an error. </p>
  
  <p>The connection string is:</p>
  
  <pre><code>&lt;add name="ELSCommonEntities" connectionString="metadata=res://*/Common.CommonModel.csdl|res://*/Common.CommonModel.ssdl|res://*/Common.CommonModel.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=localhost;Initial Catalog=els5_demo;Integrated Security=True;MultipleActiveResultSets=True&amp;quot;" providerName="System.Data.EntityClient" /&gt;
  </code></pre>
  
  <p>I have also opened up the dll in reflector and the metadata looks ok.</p>