By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,132 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,132 IT Pros & Developers. It's quick & easy.

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

P: n/a
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(AssemblyNa me 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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"lgbjr" <lg***@nospam.com> wrote in message
news:uN**************@TK2MSFTNGP10.phx.gbl...
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(AssemblyNa me 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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Browse more Visual Basic .NET Questions on Bytes