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

Strange Error Message: Context converting

1 Answer 107 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian
Top achievements
Rank 1
Christian asked on 01 Dec 2008, 12:09 PM
Hello,
I update my project from the ORM version 4.4 to the current one.
I receive the error message:
"The object of the type ' Context' cannot converted in type 'Context'"
In German: Das Objekt des Typs "Context" kann nicht in Typ "Context" umgewandelt werden.

I use this small project for testing:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using Telerik.OpenAccess; 
 
namespace ConsoleApplication1 
    class Program 
    { 
        static void Main(string[] args) 
        { 
            IObjectScope scope = Database.Get("Test001").GetObjectScope(); 
            scope.Transaction.Begin(); 
            Person MA = new Person(); 
            MA.Vorname = "Hans"
            MA.Nachname = "Test"
            scope.Add(MA); 
            scope.Transaction.Commit(); 
            scope.Dispose(); 
 
        } 
    } 
 
    [Telerik.OpenAccess.Persistent()] 
    internal class Person 
    { 
        private string vorname; 
        private string nachname; 
 
        internal Person(){} 
 
        public string Vorname 
        {get { return vorname;} 
            set { vorname = value;}} 
 
        public string Nachname 
        { 
            get { return nachname; } 
            set { nachname = value; } 
        } 
    } 
     




And the output windows reports:

------ Erstellen gestartet: Projekt: ConsoleApplication1, Konfiguration: Debug Any CPU ------ 
c:\WINNT\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /unsafe+ /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"C:\Programme\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Programme\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:c:\WINNT\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Programme\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:"C:\Programme\Telerik\OpenAccess ORM\bin\Telerik.OpenAccess.dll" /reference:"C:\Programme\Telerik\OpenAccess ORM\bin\Telerik.OpenAccess.Query.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\ConsoleApplication1.exe /target:exe ObjectScopeProvider1.cs Program.cs Properties\AssemblyInfo.cs 
 
Kompilierung abgeschlossen -- 0 Fehler, 0 Warnungen 
ConsoleApplication1 -> C:\Daten\Test Telerik ORM\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe 
 
c:\programme\vanatec openaccess\sdk\dotnet20\VEnhance.exe -assembly:obj\Debug\ConsoleApplication1.exe -config:C:\Daten\Test Telerik ORM\ConsoleApplication1\ConsoleApplication1\App.config -debug+ -verbose+ 
Enhancement complete -- 0 errors, 0 warnings 
 
OpenAccess: OpenAccessException 
Das Objekt des Typs "Context" kann nicht in Typ "Context" umgewandelt werden. 
   bei com.versant.core.logging.LogEvent.getContext() 
   bei com.versant.core.jdo.VersantPersistenceManagerImp.setName(String value) 
Das Objekt des Typs "Context" kann nicht in Typ "Context" umgewandelt werden. 
   bei OpenAccess.SPI.Backends.ThrowException(Exception e) 
   bei OpenAccess.RT.ExceptionWrapper.Throw() 
   bei com.versant.core.jdo.VersantPersistenceManagerImp.handleException(Throwable x) 
   bei com.versant.core.jdo.VersantPersistenceManagerImp.setName(String value) 
   bei com.versant.core.jdo.PersistenceManagerFactoryBase.configurePM(VersantPersistenceManagerImp pm) 
   bei com.versant.core.jdo.PersistenceManagerFactoryBase.getPersistenceManager() 
   bei OpenAccess.RT.DatabaseAdapter.GetObjectScope(TransactionProvider provider) 
   bei OpenAccess.RT.DatabaseAdapter.GetObjectScope() 
   bei OpenAccess.Database.GetObjectScope() 
   bei OpenAccess.Sdk.Addin.Sql.CreateDBCommands.DoesSQLServerDBExists(String databaseName, String serverName, String userId, String password, Boolean integratedSecurity, String driver, String backend, String connectionParams, CreateOrUpdateCaller createOrUpdateCaller) 
   bei OpenAccess.Sdk.Addin.Sql.CreateDBCommands.CheckForCreateOrUpdateDB(VAProject project) 
   bei VtShared.Sdk.Addin.Core.BuildEventHandler.Enhance(VAProject project, String projectConfigName, String platformName, String productName) 
OpenAccess Error: Das Objekt des Typs "Context" kann nicht in Typ "Context" umgewandelt werden. 
 
Create DatabaseSchema complete -- 1 errors, 0 warnings 
 
========== OpenAccess All: 0 succeeded, 1 failed, 1 skipped ========== 
    OpenAccess : Build Cancelled due to enhancement error(s). 
========== OpenAccess All: 1 succeeded, 0 failed, 0 skipped ========== 

For an hint I would be grateful.
Christian

1 Answer, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 01 Dec 2008, 02:26 PM
Hi Christian,

That looks like there are old and new dlls loaded in one Visual Studio instance. Can you please open OpenAccess->Help->Product Info and see if you see old dlls.

You should uninstall OpenAccess again, delete the complete directory and also the gac entries for both versions. After fresh product installation it should work.

Regards,
Jan Blessenohl
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Design Time (Visual Designer & Tools)
Asked by
Christian
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or