Could not load dll file

Hello,

we develop an application called DKMETRE with C and MDL.

WE have to use a dll file developed with C#( managed code) in our application (non managed code).

To make it possible, we used a wrapper DLL which allows communication between managed code and non managed code.

In the developement machine, we succed to compile and run DKMETRE application. But outside, it works on some PC but does not work on others. 

There or it does not work, we get the follows errors which prevents the execution of DKMETRE. 

so how can i solve this problem?

Parents
  • I'm working with pure .NET AddIns, that are compiled for .NET 4. Since Microstation is based on .NET 2/3.5, it doesn't load these AddIns out of the box and brings exactly Your error message instead. In case You have (and need) also .NET 4 DLL, You have to change Your ustation.exe.config:

    <startup>
       <supportedRuntime version="v4.0"/>
    </startup>

    Of course, this isn't supported and has drawbacks, but i.g. it works for me. See also: https://communities.bentley.com/products/programming/microstation_programming/f/343173/t/95436

    Robert

  • Hello,
    I tried to install a several version of vcredist but it does not work.
    In some forums, they say that this problem is related to an incorrect side-by-side configuration.

    I'd like to mention that the manifest file of my dll look like that:

    <?xml version='1.0' encoding='UTF-8' standalone='yes'?>
    <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.6195' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
    </dependentAssembly>
    </dependency>
    </assembly>

    So what do you think ?


    @robert: even if I modify supportedRuntime version, the problem persist
  • Have you used a tool like "Depends" to examine the DLL on a PC where it fails to load? Are you possibly mixing non-Debug and Debug libraries?
  • Unknown said:
    assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT'

    You've built a DEBUG version of your app.  The Microsoft redistributables are for Release versions.  If you examine your Microsoft license, you'll see that it does not permit you to redistribute DEBUG versions of the CRT.  MicroStation is, of course, a Release build.  You can't expect your DEBUG build to run correctly with a Release build of the host application.

    Unknown said:
    version='8.0.50727.6195'

    That tells you the version of the Runtime redistributable libraries (CRT) that you should deliver along with your DLL.  The place to go for those is Microsoft's web site.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: cdiTech 

Reply
  • Unknown said:
    assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT'

    You've built a DEBUG version of your app.  The Microsoft redistributables are for Release versions.  If you examine your Microsoft license, you'll see that it does not permit you to redistribute DEBUG versions of the CRT.  MicroStation is, of course, a Release build.  You can't expect your DEBUG build to run correctly with a Release build of the host application.

    Unknown said:
    version='8.0.50727.6195'

    That tells you the version of the Runtime redistributable libraries (CRT) that you should deliver along with your DLL.  The place to go for those is Microsoft's web site.

     
    Regards, Jon Summers
    LA Solutions

    Answer Verified By: cdiTech 

Children