Re: Linking or Compiling Dependencies into a .Net Assembly
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Fri, 14 Dec 2007 15:39:55 -0600
"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.
.
- References:
- Prev by Date: Linking or Compiling Dependencies into a .Net Assembly
- Next by Date: Re: learn C++.NET
- Previous by thread: Linking or Compiling Dependencies into a .Net Assembly
- Index(es):
Relevant Pages
|