This is a migrated thread and some comments may be shown as answers.

Exception: Found different versions of the same type

3 Answers 66 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Azel
Top achievements
Rank 1
Azel asked on 25 Jun 2010, 06:18 PM

I encounter the following Inner exception when trying to query for data:

Found different versions of the same type 'ExperienceAttendanceSystem.Student'; only one can be supported.  
Conflicting: file:///C:/Users/<userprofile>/AppData/Local/Temp/Temporary ASP.NET Files/root/7f4f6ad9/51a443ed/App_Code.79pup705.DLL  
With: file:///C:/Users/<userprofile>/documents/visual studio 2010/Projects/ExperienceAttendanceSystem/ExperienceAttendanceSystem/bin/ExperienceAttendanceSystem.DLL  
Make sure to reference only one version of a type. 


My code is:

           IObjectScope scope = ObjectScopeProvider1.GetNewObjectScope();  
 
            try 
            {  
                scope.Transaction.Begin();  
 
                var student = from s in scope.Extent<Student>()  
                              where s.Id == batchorid || s.Currentbatch == batchorid  
                              select s;  
 
               
               
          
 
                return student.ToList<Student>();  
            }  
            finally 
            {  
                scope.Transaction.Commit();  
            } 

 
I tried removing the cache but the exception still shows whenever I tried to compile at return student.ToList<Student>();

3 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 28 Jun 2010, 10:56 AM
Hello Azel,

this is an error message when our runtime encounters two types with the same name. Ususally it indicates, that there are two versions of the logically same assembly are loaded into memory. For your case it should be sufficient to restart the ASP development server and rebuild your application.

Kind regards,
Thomas
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jim
Top achievements
Rank 1
answered on 18 Jul 2010, 09:16 PM
I have a similar message, given below. The steps above did not work for me.  Since the problem involves the GAC, I tried removing the old version from the GAC, using the method at http://blogs.msdn.com/b/mossbiz/archive/2010/06/10/add-an-assembly-to-the-global-assembly-cache-on-windows-server-2008-r2.aspx, but was unable to make any changes at all to the GAC.

Finally I uninstalled ORM and re-installed it.  This updated the copy in the GAC and solved the problem

Message:
System.Configuration.ConfigurationErrorsException:
Found different versions of the same type 'Telerik.OpenAccess.RT.OID.SingleFieldIdentity'; only one can be supported.
Conflicting: file:///E:/Documents/Visual Studio 2010/Projects/VgTest/VgTest.Web/bin/Telerik.OpenAccess.DLL
With: file:///C:/Windows/assembly/GAC_MSIL/Telerik.OpenAccess/2010.1.623.5__7ce17eeaf1d59342/Telerik.OpenAccess.dll
0
Damyan Bogoev
Telerik team
answered on 19 Jul 2010, 06:15 PM
Hello James,

We are glad to see that you have managed to solve this problem.
If any other problems arise please contact us back.

Kind regards,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Getting Started
Asked by
Azel
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Jim
Top achievements
Rank 1
Damyan Bogoev
Telerik team
Share this question
or