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

Tech-Archive recommends: Fix windows errors by optimizing your registry



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" <lgbjr@xxxxxxxxxx> wrote in message
news:uNozWK31FHA.1332@xxxxxxxxxxxxxxxxxxxxxxx
> 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
>


.



Relevant Pages

  • Re: DLL load should be easy, but errors
    ... But I cant load even the simple DLL I ... Just supply the exe with the path to the DLL I showed. ... foreach (Type typ in types) ... 'typ.GenericParameterAttributes' threw an exception of type ...
    (microsoft.public.dotnet.languages.csharp)
  • FileNotFoundException using Excel 97 interop in C# Windows Application.
    ... One of there dll:s uses Excel 97 interop dll to parse excel Workbook. ... Application loads these dll:s by iterating through files in certain directory and tries to load assembly ... catch (Exception ex) { ...
    (microsoft.public.dotnet.framework.interop)
  • Re: How to find whether dll loaded in process is causing error
    ... You can try to find out the load address by using some tool like the ... you can find out which dll caused the exception. ... > Created a stress test tool which load the instance of IE and Keep hitting the Different Url after the specified interval of time ...
    (microsoft.public.vc.debugger)
  • problem with using dll in fortran
    ... using loadlibrary and it works fine till it encounters an exception. ... It handles them all till dll is ... however once i load the dll the settings are lost and system ... tht the dll doesnt load for the release version of the project. ...
    (comp.lang.fortran)
  • Re: (Re)throwing from a catch block across dll boundaries
    ... Thank you for the sample project, I'm able to reproduce the issue you're describing. ... within VS) and found the same results: when I linked both the Dll and the ... I have a function in a dll that throws an exception of type class CEx. ... the application crashes as well ...
    (microsoft.public.windowsce.embedded.vc)