Re: Linking or Compiling Dependencies into a .Net Assembly

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Benny" <daniel.benjamin.e@xxxxxxxxx> wrote in message news:36886149-da5e-4a15-a838-313f68c188e0@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have built a wrapper class as a dll in Visual Studio 2005 using
Visual C++ .Net. When I include the dll in another project, Project
B, on my machine, it works. When I package Project B and deploy it on
another computer, I get an error with the description below:

System.IO.FileLoadException: Could not load file or assembly
'GSLWrapper, Version=1.0.2903.28643, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. This application has
failed to start because the application configuration is incorrect.
Reinstalling the application may fix this problem. (Exception from
HRESULT: 0x800736B1)
File name: 'GSLWrapper, Version=1.0.2903.28643, Culture=neutral,
PublicKeyToken=null' ---> System.Runtime.InteropServices.COMException
(0x800736B1): This application has failed to start because the
application configuration is incorrect. Reinstalling the application
may fix this problem. (Exception from HRESULT: 0x800736B1)

Reinstalling this application does not work. I think it is due to the
missing refrerences for the GSLWrapper.dll. How can I package all of
those dependencies into the dll? I am searching configuration
settings of the C++ project for a way to do this, but I have not
successfully discovered a way to do it.

Please offer suggestions on how to comprehensively package the dll.

You can't. All .NET assemblies use dynamic linking, static linking is not permitted.

At a guess, you used VS2005 SP1 to compile your C++/CLI code, but the user's machine has only the RTM version of the runtime library. Install the SP1 version of the C++ Runtime Libraries using the exact version that came with your Visual Studio (the downloadable one isn't exactly right either). There's a file called vcredist_x86.exe, or there should also be some .msm merge modules to add to an installer.

.



Relevant Pages

  • Problem occurs in loading managed C++ dll.
    ... While trying to load a managed C++ dll getting an error "This ... application has failed to start because the application configuration ... is incorrect. ... Reinstalling the application may fix this problem. ...
    (microsoft.public.dotnet.languages.csharp)
  • Linking or Compiling Dependencies into a .Net Assembly
    ... I have built a wrapper class as a dll in Visual Studio 2005 using ... When I include the dll in another project, ... failed to start because the application configuration is incorrect. ... Reinstalling the application may fix this problem. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: dpkg -i does not install all files in a package
    ... >> I have had some problems with a package, so I tried to remove some off ... > configuration option, and will preserve this across upgrades. ... > reinstalling the package.) ... if they're dpkg-handled configuration files ...
    (Debian-User)
  • A weird problem related to P/Invoke
    ... which is related to loading a DLL (plain C code DLL) ... because the application configuration is incorrect. ... Reinstalling the application may fix this problem. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ldconfig responds with Illegal Instruction, cannot
    ... Initializing package states... ... dpkg: error processing libacl1: ... dpkg: dependency problems prevent configuration of xlibs: ... dpkg: dependency problems prevent configuration of libxi6: ...
    (Debian-User)