New Posts New Posts RSS Feed: Model/Template Mismatch
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Forum LockedModel/Template Mismatch

 Post Reply Post Reply
Author
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Topic: Model/Template Mismatch
    Posted: 28-Dec-2011 at 7:43am
I recently upgraded from DevForce 6.1.2.0 to 6.1.4.0. I cleaned the project, regnerated each of my models by right clicking on their respective tt files (there are no customizations), everything compiled without issue. However I get do get this at runtime the first time I try to instantiate my entity manager class:


IdeaBlade.Core.IdeaBladeConfig:InitializationStatusCallback : An entity model in the 'Data, Version=2011.12.23.2596, Culture=neutral, PublicKeyToken=null' assembly was generated by a different version of DevForce that is not compatible with the current version. Please regenerate the entity model base classes by resaving the EDMX in Visual Studio.
   Model template version:   2.1.2
   Current template version: 2.1.4


I have tried re-saving each EDMX, rerunning the T4 files, updating the metadata from the database, cleaning, restarting Visual Studio and still I receive this error message. What do I need to do to fix this issue?
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1390
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 8:40am
Something must be holding on to this DLL.  Try deleting the bin, obj and ClientBin folders from the application and web project folders, and then do a Rebuild on the model project. 
Back to Top
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 10:07am
I tried that and am still receiving the same error. I've attached the log file that's generated.

uploads/780/log.zip
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1390
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 10:25am
The only way this error can occur is if the assembly in question contains the old model.  The 2011.12.23.2596 version of Data.dll is what's found - is that the correct version? 
Back to Top
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 10:34am
Yes. That's the version listed in the AssemblyInfo.cs file. Its incremented only by our build script and the data assembly itself is in the solution that is experiencing the problem. The solution is totally self-sufficient in that it does not require assemblies built elsewhere in house, only on 3rd party libraries and projects within itself.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1390
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 12:21pm

Well, I'd still flush everything - the bin and obj folders from your projects.  We often set up "flush" bat files for this purpose - both to clean to avoid odd problems like this, and to reduce the zip size should we send the solution to anyone.  After flushing, back in Visual Studio do a rebuild.

It's possible that the project dependencies defined for the solution aren't correct somehow too, so that might be worth checking.

If you place any of your assemblies in the GAC, then that could be causing the problem if an older assembly with matching major/minor version is found.

Visual Studio will also cache assemblies for designer purposes.  You can also try clearing the C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\10.0\ProjectAssemblies folder.

 

Back to Top
jmpinchot View Drop Down
Newbie
Newbie
Avatar

Joined: 07-May-2010
Location: Florida
Posts: 22
Post Options Post Options   Quote jmpinchot Quote  Post ReplyReply Direct Link To This Post Posted: 28-Dec-2011 at 2:01pm
Finally figured it out and I'm delighted to report it was a PEBKAC error. While our main project makes use of 3 databases (so those are all I regenerated), other projects of ours make use of a 4th which also lives in the same assembly. Once I regenerated that one, everything compiled and worked properly.

Thanks for all your help.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down