0

I randomly keep getting this error when switching from Debug to Release when building my solution. I have no idea what is causing it and why.

I am using SQL Server 2008, and using MiniProfiler.

"Using the same DbCompiledModel to create contexts against different types of database   servers is not supported. Instead, create a separate DbCompiledModel for each type of server being used."

Anybody have an idea why?

Sometimes adding a new file, and rebuilding fixes it.

Khalid Abuhakmeh
  • 10,709
  • 10
  • 52
  • 75

1 Answers1

1

Yeah, seen this before.

EF adds a "hash" which is a signature composed of the factory that creates the entities and the entities.

With EF when you are profiling you get different Factories, so the signature changes. Once you disable it, this happens again.

The only workaround I can think of is always using the "profiled" factory for EF and disabling profiling. Also, be sure to use latest Mini Profiler from google code, as much work was done in this area.

Sam Saffron
  • 128,308
  • 78
  • 326
  • 506