I registered my 3 classes but when I go to instantiate one of the classes, I am told the class isn't registered. REGISTRATION:

public static class M1Register
{
    public static void RegisterAll( ref DomainConfiguration  config)
    {
       config.Types.Register(typeof(M1_DocumentTypes).Assembly, typeof(M1_DocumentTypes).Namespace);
       config.Types.Register(typeof(M1_DocumentElements).Assembly, typeof(M1_DocumentElements).Namespace);
       config.Types.Register(typeof(M1_Documents).Assembly, typeof(M1_Documents).Namespace);

    }
}

===================================================================================== EXCEPTION: System.ArgumentException was unhandled Message=Type 'M1_DocumentElements' is not registered. Source=Xtensive.Orm StackTrace:

   at Xtensive.Orm.Model.TypeInfoCollection.get_Item(Type key)
   at Xtensive.Orm.Key.Create(Session session, Type type)
   at Xtensive.Orm.Entity..ctor(Session session)
   at DTDB.Model.M1_DocumentElements..ctor(Session session) in D:\testbed\AADObj\AADObj\DBDocTracer.cs:line 66
   at DTDB.Program.Main(String[] args) in D:\testbed\AADObj\AADObj\Program.cs:line 32
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

InnerException:

    public M1_DocumentElements(Session session)
        : base(session)

strong text

asked Jan 04 '12 at 19:54

SkyCipher's gravatar image

SkyCipher
15112

edited Jan 05 '12 at 00:40

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211


2 Answers:

Hello SkyCipher,

Is there a probability that your Domain is being built with another configuration, without the type registration from the code above?

answered Jan 05 '12 at 00:46

Dmitri%20Maximov's gravatar image

Dmitri Maximov
22111211

What it turned out to be is a cut and paste error on my part. I didn't catch the qualifiers [Serializable] [HierarchyRoot] before my class definitions. I am now looking at a property position error but this issue appearrs to be solved. Thanks for the tip about the domain, I will add it to things to check when my code starts throwing exceptions in my dataobject code. This is my 1st day of development so things happen.

answered Jan 05 '12 at 01:45

SkyCipher's gravatar image

SkyCipher
15112

Great that you have a progress, but have you missed our manual? It can be found here: help.dataobjects.net.

Hope that helps

(Jan 05 '12 at 03:50) Dmitri Maximov Dmitri%20Maximov's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA