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
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