Entity + GAC’d Assembly == Hell?!
Okay, so I’m trying to have the .NET conversion of the site at work use Entity for our Data Access Layer. Seems reasonable. I also figure I’ll represent the different silo’s of data (accounts, catalog, etc) into their own Entity Contexts and in their own Assemblies… all under a namespace.. like DAL.Accounts or DAL.Catalogues. So far so good.
Now my thinking goes that I’ll want these accessible by any of the web applications we’ll be creating for the site. And I’ll only want to maintain one copy of the files rather than spread across all the web apps. So clearly I should put the assemblies in the GAC.
First issue comes up is that the default connection string is stored in the app.config file. This isn’t put in the GAC. So, no default connection string. Hrmmm okay…
Well, if I put the appropriate connection string in the web.config of the web app this should suffice. Hrmm stretching a bit.. but okay. Ooop, nope. Not working. Well, perhaps I need to be specific about the assembly name in the reference section of the connection string. Noooo… still hates me. In looking at the documentation is looks like (if I read it correctly) it’s going to search for the resources files in assemblies in every spot BUT the GAC!
Sure, sure… I can create a context and pass the connection string in by hand. okay.. that works. I even created an EntityFactory class in the assembly to pass back a new context… so I don’t have to worry about knowing the connection string. But, I’m faced with the fact that none of the data binding is working.
What am I, or Microsoft, doing wrong here? Clearly one of the two of us is at fault.

Latest Comments