Print Page | Close Window

Model/Template Mismatch

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3183
Printed Date: 16-Apr-2024 at 2:47am


Topic: Model/Template Mismatch
Posted By: jmpinchot
Subject: Model/Template Mismatch
Date 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?



Replies:
Posted By: kimj
Date 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. 


Posted By: jmpinchot
Date 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 - uploads/780/log.zip


Posted By: kimj
Date 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? 


Posted By: jmpinchot
Date 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.


Posted By: kimj
Date 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.

 



Posted By: jmpinchot
Date 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.



Print Page | Close Window