No parameterless constructor defined for this object.

No parameterless constructor defined for this object.

Old forum URL: forums.lhotka.net/forums/t/6194.aspx


esteban404 posted on Monday, January 19, 2009

Using csla 3.0.5 in a WinForm app, no proxy, no remoting.

I'm getting the subject error when attempting to instantiate a new BO. I also see "If a method in a class library has been removed, recompile any assemblies that reference that library." Well, I haven't, but I'm getting a fresh copy of the 3.0.5 release and will recompile and relaunch PTracker example.

When stepping through, I see that global context is null stepping into the csla.DataPortal and I see
result = proxy.Create(objectType, criteria, dpContext);
where dpContext is null. Seems strange.

I can use NVL just fine, but when I started to debug the guts of the code in a real BO, I ran into problems. In my DataPortal_Create method I do go to the db, so there's no [RunLocal] decoration.

Any suggestions?

esteban404 replied on Monday, January 19, 2009

It's in the create method in the SimpleDataPortal. I've found some threads, but I don't understand what I've done wrong in the code. It fails when it hits this line
obj = Activator.CreateInstance(objectType, true);

The debugger says it's of the correct type, but I don't get any further.

Any help?

esteban404 replied on Monday, January 19, 2009

Found it. It's going for the time being. :-)

jkornit replied on Tuesday, March 24, 2009

what was the answer?

I am running into it too.

jkornit replied on Tuesday, March 24, 2009

never mind (thanks anyway)  I got it.

 

I had commented out the ctor in order to force a parameter... big no no.

i re-added the parameterless ctor.

Copyright (c) Marimer LLC