I created a C# application that uses a C++ dll and im trying to create an install package that will allow this to run on other computers whether they have VS or not, the problem is i don't know what C++ libraries i need to let it do this. When i run just the application on a blank virtual machine it says " xxxx has encountered a problem and needs to close." If i go and download visual studio 2008 express version and install it on the machine, the my program will run fine. problem is express is 85-185mb to download and 335mb up to 1.1gb to install on a machine, the program that is using it is only 33kb. huge overhead there... if i install just the C++ redistributable from msdn site, it takes up 4mb, but it wont let me run my program.
what packages from C++ do i need to m开发者_StackOverflowake this program run on a blanked computer?
That question can be tough to answer. If you have the source of the c++ dll you should be able to see its dependencies unless the person used a lot of com or load library calls. One of the best tools I used to get c++ depencany info was depends.exe. One thing to check if its your code is that you are not using debug version with dependencies on debug dll that I think are not in the redistributable.
caleb, I recommend you a program called Dependency Walker. It will show you all the dll dependencies you have. I'm sure there are much more of them for Windows but that's the one I've been using for quite a while and I like it. So you did right by downloading the redistributable package from the MS web site but your app probably depends on some other libraries. When I tried to build my installer long time ago using Visual Studio I remember it was a way to include a redistributable package in your installer or use side-by-side installation - depending whether the license agreement of your Visual Studio version allowed you to do that or not. Also you could include all the dll dependencies you have in the installer.
Hope that helps
The C++ runtime dlls you need are the ones provided with the compiler as redistributable package and exactly this one! Other redist packages won't necessary work because of the manifests embedded in the executables which require an exact version (checked by a hash value of the binaries in the side by side assembly directory C:\Windows\SxS)
So you are right with the redistributable but you need the one that was installed with the compiler not one from a best guess from the internet. The exact versions can be looked at in the manifest files (XML)
精彩评论