Exception: FILE NOT FOUND - Deploying C++ app on windows server 2008 R2 - c++

The Problem: C++/CLI application is throwing file not found exception on windows server 2008 R2 because msvcr120.dll is not available in system32 folder. Instead, there is file with name msvcr120_clr0400. Vc++ 2012 update 4 and .net framework 4.5.2 is installed on windows server.
Exception Details:
a few details of exception:
Problem Event: CLR20r3
Problem Signature 8: 124
Problem Signature 9: file not found exception
Application build configs:
visual studio 2013x86release.net 4.5vc++ 2012
Dependencies: checked from dumpbin utility
kernel32.dll
MSVCR120.dll
MSVCP120.dll
mscoree.dll [ from windows/system32 folder ]
opencv dlls and some other dlls - resides in exe folder.
Now, my Questions are that
is there any difference between deploying c++ application to windows server and on other end-user windows editions?
should I install Vc++ 2012 [without update] as well?

It sounds like the wrong version of Visual C++ Redistributable Package. Depending on your opencv version I think you need a different version vcredist.
Edit:
msvcr120.dll is part of Visual C++ Redistributable Packages for Visual Studio 2013 microsoft.com/en-US/download/details.aspx?id=40784

Related

What DLLs to add to my Visual Studio 2017 project?

I have a C++ project compiled on Windows 8.1 that doesn't work on some computers. On another Windows 8.1 machine it doesn't open because it's missing a DLL file api-ms-win-core-*. On Windows 7 machines it crashes with a BEX error.
I link dynamically against the runtime library (Multi-threaded DLL (/MD)) and include the following DLLs in the same folder as my executable:
msvcp140.dll
ucrtbase140.dll
vcruntime140.dll
Is there anything else I should include?

how to forece mfc to use Redistributable 2013 or below

I create an Activex by vs2015 and '/clr' option. when i run it on other pc's, it need Redistributable 2015.
But Redistributable 2015 not installed on win8.1 and win2012 server. but Redistributable 2013 installed on them.
How can i force mfc to use Redistributable 2013? (or better solution)
i checked this but not helpful.
and changing Platform Toolset to Visual Studio 2015 - Windows XP (v140_xp), generate some errors in a hello-word project
i use Activex because i need events
it use 'clr' option, because i use a managed dll in this activex
Redistributable 2015 log Error 0x80240017: Failed to execute MSU package apparently for Windows8.1-KB2999226-x64.msu
Windows8.1-KB2999226-x64.msu standalone installer say The update is not applicable to your computer.
installing a Net4.6 suggested, But this installer blocked by The update corresponding to KB2919355 needs to be installed before you can install this product on Windows 8.1 or Windows Server 2012 R2 and this update is 690.8 MB, and that MB blocked me.
You can not switch Visual Studio to use older toolset. You have to either - install older version of MSVC, or link your program statically, removing need in the redistributable altogether. To staticaly link your project open its Release properties, navigate to the C++/Code generation node and select Multithreaded instead of Multithreaded Dll for the Runtime option.

Policies folder in WinSxS in Windows 7

I am trying to run a native application that was built using Visual Studio 2008 in Windows 7. I have installed Visual Studio 2008 on the new machine. I get an error saying that the side-by-side configuration is incorrect. So I copied the needed redistributable files and manifests from the old system(Windows XP) to my new machine(Windows 7) at the same location. But still I am not able to run the application. I am actually not able to find a folder called 'Policies' that was present in Windows XP's WinSxS folder. Where can I find this folder and how can I run the application?
Thanks,
Rakesh.
All visual studio versions have a matching redistributable package. This is an executable which when run will set up the SxS folder as needed. You're best off treating this as magic.
I think SxS is one of the worst ideas Microsoft ever had in Win32 development

Compile ATL project with only Windows SDK 7.1

I have a project which needs to be compiled. It is compiled on our build server which I have only installed Windows SDK 7.1 on. I would like to not have to install an actual Visual Studio on this machine, but am getting an error "cannot find atlstr.h" file which I've just read is part of ATL which is part of Visual Studio.
Is there any way I can get this to compile without installing Visual Studio on the build server?
ATL is now freely available as a part of Windows Driver Kit: http://msdn.microsoft.com/en-us/windows/hardware/gg487438.aspx
No. ATL is a fundamental part of the non-free versions of MSVC.

Application not running on a PC with VS 2008 not installed

I have been working on a project using OpenCV and have made a face detection project.
I would like to know why does an executable created using Visual Studio 2008 not run on another pc and give the following error:
"This application has failed to start because the application configuration is incorrect"
Perhaps you need the Visual C++ Runtime package installed.
Available for download .... here
You need to install Microsoft Visual C++ 2008 Redistributable Package on the machines you are deploying your application first - http://www.microsoft.com/download/en/details.aspx?id=29
The Microsoft Visual C++ 2008 Redistributable Package (x86) installs
runtime components of Visual C++ Libraries required to run
applications developed with Visual C++ on a computer that does not
have Visual C++ 2008 installed.
Another thing to note is you will have to take the binary from Release build (not Debug.) The Debug build wouldn't run on the deployment machine even if the VC++ Runtime is installed.