herbert422

I created a GUI class that has all of my GUI controls. This solution, Solution #1, has two references "added in the Reference section of the Solution Explorer" for third-party controls. When I run the application, it runs fine. Then I commented out the Program.cs file, and re-compiled the solution as a class library.

This paragraph now talks about another solution, Solution #2. When I try to instantiate an instance of the form using Reflection on the assembly generated by Solution #1, I get an error stating that one of the third-party DLL is missing. I loaded explicitly loaded both the 3rd party library into the program of Solution #1 prior to making the call to instantiate the Form class.

When I add the 3rd party library to the bin location of Solution #2, it works fine. Is there a way to force the dll of Solution #1 to look elsewhere for those 3rd party library I can not dynamically load the 3rd party library in Solution #1, as I need them for desiging the GUI with the IDE form editor.

Thank You,

Jason Ki



Re: .NET Base Class Library Run time creation of class from DLL generates Assembly Not Found Exception

herbert422

Any thoughts





Re: .NET Base Class Library Run time creation of class from DLL generates Assembly Not Found Exception

Peter Ritchie

How are you loading this assembly in solution #2 and where is it located (e.g. if you're using LoadFrom...). If the 3rd party assembly isn't in an accessible location from the location of the assembly you're loading, it won't have access to it--regardless of whether that 3rd party assembly has been loaded already. That's fundamental security in .NET.

You can copy the 3rd party DLL into the same directory as the assembly you're loading, or if you give us some detail on how you're loading this assembly we can offer some alternatives.