SqlServices.Install is locking the database?
I'm trying to do some integration test in a csharp project, I'm using Entity Framework 4. In the tes开发者_如何转开发t setup I'm recreating the database with
_container.DeleteDatabase();
_container.CreateDatabase();
And then adding the asp.net membership to the database with
SqlServices.Install(
"MyDb",
SqlFeatures.All,
ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString);
Everything works fine in the first test, but the setup for the second test fails, with a message that can't drop the database because is in use. If I don't try to create the membership structure all the tests works fine.
There is any way to free the database?
Thanks In Advance
I found a solution!
I add Pooling=False in the connection string in the membership configuration and now is working
精彩评论