Visual Studio 2012 testing with csla and entity framework
c#, csla, entity-framework-4.3, mstest, visual-studio-2012
Solution
I found my real issue. VS2012 runs the tests in a separate AppDomain and our data access layer loads via Reflection. Still not sure why EF requires knowledge of the principal but our solution was to reset our principal to a GenericPrincipal prior to accessing EF then placing back the original. I am still wrestling with the thought that maybe an IoC container would alleviate this issue
Problem
In VS2010 my MSTest test run just fine. When running in VS2012 I am getting an error. The test sets the Csla.ApplicationContext.User with a Custom Business Principal. When the EntityFramework is asked to provide a new ObjectContext I receive a SerializationException saying that my Custom Business Principal type cannot be found. All the tests that use the EntityFramework fail when running through VS2012's test runner or Resharper7's test runner. I have tried NCrunch's test runner and they all pass. How can I resolve this issue?