New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load the specified metadata resource of EF connection string #47

Closed
hatelove opened this Issue Oct 15, 2015 · 8 comments

Comments

Projects
None yet
2 participants
@hatelove

hatelove commented Oct 15, 2015

I create a edmx data model by EF to connect Northwind database in my localDB and write a simple sample code to query data. The test will pass, but alive launch test case will throw exception "Unhandled MetadataException: Unable to load the specified metadata resource".

sample code: https://gist.github.com/hatelove/6e2b910c8bc9f47e1253

test failed information:
image

test passed by running test:
image

here is my connection string information of App.config:

<connectionStrings>
    <add name="NorthwindEntities" connectionString="metadata=res://*/NorthwindModel.csdl|res://*/NorthwindModel.ssdl|res://*/NorthwindModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(localdb)\v11.0;initial catalog=Northwind;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

There is nothing strange in Alive output window.

VS2015, EF v6.1.3, NUnit v2.6.4, Alive v0.6.5

@JoshVarty JoshVarty added the bug label Oct 15, 2015

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Oct 15, 2015

I'm not sure what causes this, but it's possible we're not using a .config file properly.

JoshVarty commented Oct 15, 2015

I'm not sure what causes this, but it's possible we're not using a .config file properly.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Nov 12, 2015

Sorry it's taken me so long to get to this. I'm not sure if you remember the problem exactly, but do you know:

  • Was there multiple projects in the solution?
  • If so, which project had the ConnectionString in its App.config file?

JoshVarty commented Nov 12, 2015

Sorry it's taken me so long to get to this. I'm not sure if you remember the problem exactly, but do you know:

  • Was there multiple projects in the solution?
  • If so, which project had the ConnectionString in its App.config file?
@hatelove

This comment has been minimized.

Show comment
Hide comment
@hatelove

hatelove Nov 12, 2015

My production code project has EF ConnectionString and my test project has one, too.

I usually create an overload constructor with connection string argument in my DataContext class.

hatelove commented Nov 12, 2015

My production code project has EF ConnectionString and my test project has one, too.

I usually create an overload constructor with connection string argument in my DataContext class.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Nov 12, 2015

I've looked at the error online and found a couple leads on what it might be. It's possible we're not copying certain resources to the output folder.

We've never used EntityFramework before, so I'm downloading SQL Server and setting up the Northwind sample to try to reproduce this. I'll update this issue as I make progress.

JoshVarty commented Nov 12, 2015

I've looked at the error online and found a couple leads on what it might be. It's possible we're not copying certain resources to the output folder.

We've never used EntityFramework before, so I'm downloading SQL Server and setting up the Northwind sample to try to reproduce this. I'll update this issue as I make progress.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Nov 12, 2015

Alright, I've installed Northwind and EF and can reproduce:

image

Hopefully I'll be able to figure this one out quickly and we'll have a fix in the next release.

JoshVarty commented Nov 12, 2015

Alright, I've installed Northwind and EF and can reproduce:

image

Hopefully I'll be able to figure this one out quickly and we'll have a fix in the next release.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Nov 27, 2015

This has proven to be a little more difficult than I thought. It turns out EntityFramework is rewriting DLLs after they're compiled and inserting Metadata artifacts into the assemblies.

I've opened a Stack Overflow question to hopefully learn how we can use the EntityDeploy build task to get this working: http://stackoverflow.com/questions/33952883/invoke-entitydeploy-build-task-programatically

JoshVarty commented Nov 27, 2015

This has proven to be a little more difficult than I thought. It turns out EntityFramework is rewriting DLLs after they're compiled and inserting Metadata artifacts into the assemblies.

I've opened a Stack Overflow question to hopefully learn how we can use the EntityDeploy build task to get this working: http://stackoverflow.com/questions/33952883/invoke-entitydeploy-build-task-programatically

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Jan 19, 2016

I've finally got a fix together for this one. :)

Sorry it's taken so long. We'll plan to release this fix in our next weekly release.

JoshVarty commented Jan 19, 2016

I've finally got a fix together for this one. :)

Sorry it's taken so long. We'll plan to release this fix in our next weekly release.

@JoshVarty

This comment has been minimized.

Show comment
Hide comment
@JoshVarty

JoshVarty Feb 2, 2016

We've released this, please let us know if you have any other issues with EF.

JoshVarty commented Feb 2, 2016

We've released this, please let us know if you have any other issues with EF.

@JoshVarty JoshVarty closed this Feb 2, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment