Runtime error in vb.net app: An unhandled exception of type 'System.TypeLoadException' occurred in...

I have a solution including approximately 20 projects. One of these projects (EscoRatePlanOffering.dll) is referenced (as a project) by 4 other projects. The solution compiles without a problem, but I am getting this runtime error when I try to instantiate an object that is referencing the dll and sometimes when I try to create an instance of the EscoRatePlanOffering object itself:
An unhandled exception of type 'System.TypeLoadException' occurred in rateplanmaint.dll
Additional information: Could not load type eco.TypedDataSets.EscoRatePlanOffering from assembly EscoRatePlanOffering, Version=1.0.2283.3213, Culture=neutral, PublicKeyToken=null.
 I tried removing the references to the dll, deleted all copies of the dll on my machine, and rereferenced the project (dll). I am still getting this runtime error and cannot figure out the source of the problem. I would greatly appreciate any assistance you can provide here. Thanks.
EconnergyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cubixSoftwareCommented:
Hi

Does EscoRatePlanOffering.dll have any use of datasets and if so have you re-created these then recreated the DLL, references etc.

Additional information: Could not load type eco.TypedDataSets.EscoRatePlanOffering from assembly EscoRatePlanOffering


It might be your DLL is okay but it is something inside it that it itself is trying to reference that could be the problem.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
EconnergyAuthor Commented:
Hi,
Thanks for the reply. The EscoRatePlanOffering.dll does include a dataset. I will try recreating it and referencing the dll. What did you mean by it might be the DLL is okay but it is something inside it that it itself is trying to reference that could be the problem?
0
cubixSoftwareCommented:
What I mean is your code is creating an instance of the EscoRatePlanOffering object and sometime you get the error. The natural assuption is it must be the DLL itself that is the problem but all I am trying to say is as EscoRatePlanOffering gets created, it itself might have references to other objects so when EscoRatePlanOffering is being created, it also then tries to create an instance to those objects it references and it is during this that an error occurs that then get propergated back and looks like it is the EscoRatePlanOffering object itself that is corrupt.

Thinks of it like a chain, your client object creates an instance of EscoRatePlanOffering object, but if EscoRatePlanOffering needs to reference Object A then it creates an instance of A, and if Object A references object B then A creates an instance of B, and if B references C then B creates C etc.etc.

All of this would happen when you create your instance to EscoRatePlanOffering object and any error at any point in this this chain would come back through the call stack looking for an error handler and if one is not found then it would break your application, right after the line of code that states "create EscoRatePlanOffering object"

0
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

cubixSoftwareCommented:
Hi

Have you managed to resolve this or are you still having problems....
0
EconnergyAuthor Commented:
Thanks alot! I deleted the dataset and recreated it, and my problem has not recurred. I hope the issue is completely resolved, will let you know if it persists, but it seems fine. Thanks again.
0
EconnergyAuthor Commented:
The error just recurred. Any ideas? I didn't mention before - I also have a user control that is referenced by some of the projects in the solution, which references the EscoRatePlanOffering dll.
Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.