StrataFrame Forum

Trouble assigning parent objects

http://forum.strataframe.net/Topic18583.aspx

By Jason Seidell - 8/19/2008

In my project when I try to set a ParentBusinessObject I keep getting

'TypeLoadException occurred'
Could not load type 'Infinedi.BO.Processing.Reports.TB50000_BO' from assembly 'MicroFour StrataFrame Base, Version=1.6.0.0, Culture=neutral, PublicKeyToken=99fe9917f71608a7'.

I have rebuilt the business objects and the libraries, manually deleted old library from the GAC, checked my project references, and I keep getting this error.  If I just ignore it everything runs fine, but it is really annoying when my project keeps stopping on the error.

Jason

By Dustin Taylor - 8/19/2008

That's an interesting one.



It's late, so I'm probably overlooking something obvious, but a couple questions Wink: Are you setting the parent relationship in code or via the UI? Have you created your own version of StrataFrame Base .dll (i.e. edited the strataframe source code?)
By Jason Seidell - 8/21/2008

No I haven't rewritten the Base library.  I also tried down reving to 1.6.0 and I still get the same error.

I went to the Business Object and through the GUI I set the ParentRelationship property, and then in my code I set the ParentObject and it throws the TypeLoad exception.  If I am stepping through the code it will continue on and everything runs fine, but when I compile it crashes.

By Greg McGuffey - 8/21/2008

I'm not quite sure if I understand what's going on, but you might try rebuilding your solution or even a clean and rebuild.
By Dustin Taylor - 8/22/2008

Well, now that I think about while I am fully awake (thank you, coffee w00t ), I doubt the mentioning of strataframe base in the error is signifgant. The bottom line is that there is more than one version of your .dll present on your machine. It could be different versions of the StrataFrame .dlls (though I don't think it is), so you should probably make sure that your GAC and any local copies of the dll line up.

Past that, it is looking like you have different versions of your .dll being referenced on the same machine. I know you said you cleared out your GAC, but there may be an old version of the dll sitting out on disk that the project keeps finding and trying to grab, or a reference might be trying to access and older version.

By Jason Seidell - 8/25/2008

That is a definite possiblity I will follow up and see what I can find.  Just today at lunch I was telling my co-developers M$ gives you something with one hand and then slaps you with the other.  So we no longer have DLL hell, now it the ghost library/gacKED problem.  From a development stance I think the DLL situation worked far better... you just couldn't install it on anyone's elses machine....
By Jason Seidell - 8/25/2008

Ok I figured out what is going on, somehow the 'Just my code' under Tools->Options->Debugging got unchecked and it seems the strataframe function is doing exactly what it's supposed to, it checks for the type in the SF base library and then if that fails it recursively checks the project references etc until it finds the correct type.  It just threw me for a loop when everything is working fine, and then the project starts barfing on startup when I haven't even changed anything.
By Dustin Taylor - 8/26/2008

Sweet, glad you got it working BigGrin