File or assembly name XXX, or one of its dependencies, was not found

L

lgbjr

Hi All,

I am moving some of my MDI Child forms to DLLs. The first 3 forms worked
fine. But the 4th one is causing me some grief! I use the following code to
load a form from a DLL:

Dim asmAssemblyContainingForm As [Assembly] =
[Assembly].LoadFrom("neiconv.dll")
Dim TypeToLoad As Type =
asmAssemblyContainingForm.GetType("neiconv.Frm_ND")
Dim GenericInstance As Object
GenericInstance = Activator.CreateInstance(TypeToLoad)

Dim NDfrm As Form = CType(GenericInstance, Form)
NDfrm.MdiParent = Me
NDfrm.Text = NDfrm.Text + " for " +
Frm_ND.NDncffname(Frm_ND.NDncffname.Length - 1)
NDfrm.Show()

The form (DLL) that is causing problems does not use any different form
components than the first three, but I get the following exception at the
first line of code above:

File or assembly name neiconv.dll, or one of its dependencies, was not
found.

at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at CNRGITools.MainMDI.Menu_ND_Click(Object sender, EventArgs e) in D:\My
Documents\Visual Studio 2003\Projects\CNRGITools\MainMDI\F_main.vb:line 2196


The DLL itself compiles fine.

Any ideas?

TIA
Lee
 
L

lgbjr

Hi All,

Another piece of information (maybe useless):

I'm catching the exception mentioned previously. After the exception occurs,
other forms that I try to load (from other DLLs) throw the same exception.
Once I restart the app, the other forms load fine.

Regards,
Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top