Side-by-side assemblies, Windows 7, and Visual Studio 2005 - visual-studio-2005

I have a Windows 7 machine with Visual Studio 2005 SP1 installed. Using this, I build an application which loads a DLL at runtime compiled with VS2005 SP1 but on Windows XP. This fails, with the following error:
"...\foo.dll": The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.
The DLL loaded is compiled against the debug CRT. The answer to this question hints that vcredist_x86.exe only contains release-versions of the CRT. I'm not sure if that is relevant in this case, since both my machine and the machine on which the DLL was compiled on both have the full VS2005 SP1 installed.
Should I attempt to rebuild the DLL on Windows 7 (I'd prefer not to), and will that cause the DLL to become unusable on the Windows XP machine?

Problem solved. The problem was that the Windows 7 machine did not have the KB971090 update which was installed on the Windows XP machine which built the DLLs. I had to explicitly tell Windows Update that I wanted to receive non-Windows updates in order to be able to install the update.

Related

Visual Studio 2008 DEBUG build of 32-bit appli CRASHES on a 64-bit Win 10 PC but same appli works when we install Visual Studio 2008 on 64-bit Win10

I'm facing the following issue:
Background
I have a Win32 legacy application (exe & dll's) and drivers (dll's) written on Visual Studio 6.0 that used to run
well in Debug version on Windows Xp (Please Note: We need it in DEBUG configuration & not Release).
I copy the Visual studio 6.0's msvc* type dll's, MFC dll's & manifest files along with the exe to make it run.
Issue:
The same legacy 32-bit application & driver dll's have now been newly compiled in Visual Studio 2008 DEBUG mode.
It is then copied to a PC running on 64-bit Windows 10 PC (also tried Windows 7 without success) without having VS2008
installed. I copy the VS2008's msvc* type dll's (msvcp90d.dll, msvcr90d.dll), MFC dll's and manifest file (Microsoft.VC90.DebugCRT.manifest) also along with the exe.
On launching this debug version of the application (it does many initialization activities on startup and also calls the init methods of driver dll's) it crashes on starting up both on a 64-bit Windows 10 & Windows 7 PC.
What works:
When VS2008 is installed on the Windows 10 PC, the application's debug version launches correctly without crash and works fine.
(Also please note that same application's Debug build using the old Visual Studio 6.0 works fine on Windows 10).
What DOESN'T work:
When VS2008 is NOT installed on a Windows 10 PC, the application's debug version crashes while it is being launched.
Requirement
We absolutely need the DEBUG configuration of the application to run on the Windows 10 PC.
Development environment
OS for development: 64-bit Windows 7
Target OS: 64-bit Windows 10
IDE: Visual Studio 2008 SP1
Application & driver dlls/exe's: 32-bit
I have tried many workarounds like building by using 32-bit paths in VS2008 ($\Program Files (x86)\Microsoft SDKs\Windows..),
installed redistributables of VS2008 (both x86 & x64),
running as 'Administrator' user,
running in compatibility mode (Win Xp..),
copying dll's from system32 folder of a PC having VS2008 installed to a PC without VS2008 etc.. but the Debug build always crashes on it's startup.
Any help or pointers would be appreciated.
Please let me know if you would like to have further details.
Thank you in advance.

.exe gives error MSVCP120.dll is missing for Win7x64

I created .exe using VS2013 and I added it directly to control panel by giving registry path. I built it for x64. It launches perfectly fine for Win8.1x64. But when I launches it on Win7x64 it gives MSVCP120.dll error. If I copy dll it works. But does the dll's are connected directly to .exe? If not how do I attach them?
Your error just means that the MSVC redistributable for VS2013 is missing from the Windows 7 computer. Windows 7 doesn't have this DLL by default.
However, please don't copy DLLs around willy-nilly. You need to make sure the redistributable is installed either as part of your installer or separately by the user. For example, you can have your installer detect the existence or not of the redistributable and alert the user to install it. You could include it with your installation package, which is allowed.
Note that there are 2 versions of the redistributable, for x86 and x64. You need to supply the right one(s) for your application. You can use this link to download the Visual C++ redistributable packages for Visual Studio 2013.
Even if you're using x64, you need to install also x86 version of MSVC redistributable.
I had this problem myself as well. I found that even after installing x64 version of MSVC redistributable, the msvcp120.dll file was missing in SysWOW64 directory. The issue was solved after installing also x86 version.

Build old VC 6 C++ apps on Windows 2008 R2

I have old source that needs to be compiled on VC 6 C++ version.
For that I run a Windows 2008 (32bit) virtual machine and installed the 2003 platform SDK.
I wanted to make a new machine running windows 2008 R2 and therefor it is Windows SDK for Windows Server 2008 and .NET Framework 3.5 available to install.
So here is the question: Does this platform SDK include the old includes, header files and libs so I can compile the sources or is that not possible at all?
Tho I can't install the 2003 platform SDK on the 2008 R2 machine (at least the default setup won't let me do it).
Just for everyone to know asking the same: I had no problem installing VC++ 6 on a Win2k8 R2 even with warnings. Moved all SDK Files to the machine as well and manually setup all the include, libs, app pathes in the correct sort order I had on the other machine.
Compiled all components without a problem. So finally it seems it works even with some stress-calls from the setup program that there is no support for this.

How to target Windows XP sp3 when compiling with Visual C++ 2010?

I am trying to compile a C++ program using Visual Studio 2010 Pro on a Windows 7 computer to target Windows XP sp3 32 bits.
I've played around with the compiler and linker settings, but I'm unable to produce an executable that can run on my Windows XP computer. I always get the error "Could not find entry point for function GetTickCount64 in kernel32.dll" and the program doesn't run. I know Windows XP does not support GetTickCount64() and I'm not using it in my code anyways.
I don't have other versions of Visual Studio installed, and I already installed Visual C++ 2010 Redistributable Package on the windows XP machine.
Any idea on how to accomplish this?
Thanks before hand.
VC2010 targets Windows 7 by default.
To change target to XP, check Using the Windows Headers

visual studio 2005 .exe file not running on another computer

I have a visual studio 2005 c++ application running on a windows 7 64 bit machine.I tried to run it on another computer having windows 7 64 bit but when I copied it on to the desktop and runs the .exe file,there was no response.But I dont have the visual studio 2005 ide installed on the new machine and I am currently instaling it. Also, I googled and got lot of confusing answers. Can someone tell me what will be possible problem here?
Try installing the "Microsoft Visual C++ Redistributable Package" on the machine where the executable is not working.
You need to build for Release not Debug to run the application on a PC without Visual Studio. If you're already doing that, try loading the EXE into Dependency Walker on the target machine to see what other libraries might be missing.

Resources