Visual Studio 2005 (and other) : how to deploy debug dll (msvcp80p.dll & friends, for debugging purposes) - visual-studio

I am trying to run (and debug) my application on a remote computer where Visual Studio 2005 is not installed.
My current problem is that I am facing the (in)famous error : "The application failed to start because the application configuration is incorrect".
Here is what I did :
1) Install all the required vcredist on the target computer :
(I do need all theses versions since some libraries were compiled some months ago, with a previous runtime...).
Microsoft Visual C++ 2005 Redistributable Package (x86)
Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update
Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update
After installing those redist, the release version works fine.
2) Install the debug dll following the instructions given on the following MSDN pages: Preparing a Test Machine To Run a Debug Executable and at How to: Deploy using XCopy
As mentioned in "Preparing a Test Machine To Run a Debug Executable":
I did run "msiexec /i microsoft_vc80_debugcrt_x86.msm" --> This did not solve the problem.
After that, I added "msiexec /i policy_8_0_Microsoft_VC80_DebugMFC_x86.msm" --> No luck either.
As a last resort, I did "msiexec /i" for all the msm that are in C:\Program Files\Common Files\Merge Modules\*VC80*.msm --> No luck either
As mentionned is "Deploy using XCopy":
I also copied (in subfolders) all the subfolders of
C:\Program Files\Microsoft Visual Studio 8\VC\redist\x86\
and
C:\Program Files\Microsoft Visual Studio 8\VC\redist\Debug_NonRedist\x86\
to my app dir on the target machine.
The problem is still present.
Does anyone know what I might be missing ?

Let me answer my own question : the easiest way is to add a "Setup and deployment project" to the solution.
Right click solution / Add new project : Other Project types / Setup and deployment
Right click the new deployment project and select "Add/Project Output" then select your target project
--> this will create a msi that will install all required debug dll !
(Once installed by the msi, the debug dlls are deployed once and for all : you will not need to reinstall them using an msi each time you want to test a new build).

You can use the Dependency Walker tool to find what DLL(s) you missed.

Related

MSBuild offline installer that comes with visual studio 2017 build tools not able to build project in Release mode

Step 1 - I have installed visual studio build tools by downloading
vs_BuildTools.exe from this site (you will require to login to microsoft account to browse this URL)
Step 2 - I created offline installer by following various articles particularly this one
And created zip file offlineBuildTools17.zip
Step 3 - Copied offlineBuildTools17.zip file to Build server which doesn't have internet connection.
Build server is Windows server 2012 R2.
Step 4 - Extracted Zip file on server and installed Build tools. Installation goes smoothly.
I could see installation files in
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft
Step 5 - I have simple DLL and Console application (.exe) project in my solution. These are simply 'hello world' application NOT USING DOT NET CORE. I am using .net frameowrk 4
Problem: I am unable to create release mode dlls and exe
Same thing is working on my laptop where I have installed visual studio 2017 community edition.
On laptop where visual studio 2017 installed
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild" <optional project.csproj> /p:Configuration=Release
This creates dlls and exe in bin\Release folder of project
But the same doesn't work on Build server.
Always creates dlls and exe in bin\debug folder.
My final goal is to create 'publish' folder
This is weird but it is solving my problem.
if i ran following command - msbuild is always generating Debug binaries. which was my original problem. it doesn't generate release mode binaries at all
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\"msbuild /p:Configuration=Release /t:publish /p:OutDir="./Publish"
But if i write following command , (note how msbuild is placed in double quote along with mbuild full path) it is working fine. it generates release mode binaries and also publish folders.
"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild" /p:Configuration=Release /t:publish /p:OutDir="./Publish"
thanks

Visual Studio 2017 does not detect Windows Driver Kit installation

I already have Visual Studio 2017 professional with Desktop Development with C++ installed.
I am trying to build the Virtual Serial project found here:
https://github.com/Microsoft/Windows-driver-samples/tree/master/serial/VirtualSerial
When I try to build it, I get the error:
Severity Code Description Project File Line Suppression State
Error MSB8020 The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". virtualserial C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets
I cannot find any instructions on installation aside from this website.
https://learn.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
I downloaded the WDK for Windows 10, version 1803.
I closed VS2017 and ran the installer.
When running the installer I got the message in the screenshot below, I clicked Next to continue installing
After running the installer, the project still does not build, with the same error: WindowsUserModeDriver10.0 is not installed.
What am I missing during installation? Is this the correct installer for regular VS2017 (not community edition)?
Thanks,
I know this is old, but I recently fell into this rabbit hole. What worked for me was uninstalling all of the WDKs, rebooting, and installing WDK 1803 (the wdksetup.exe program downloaded from Other WDK downloads shows version 10.0.17134.1 in properties). That WDK installer specifically calls out VS 2017 when you add the Visual Studio integration at the end of the install process.
In my situation, I installed vs2022 with SDK 19041 and WDK 19041.
After some testing, I realized that VS2022 only supports WDK 22621(so on this date). So I installed WDK 22621 and SDK 22621, and problem solved.
If you still can't find Kernel Driver Build option, try run this file C:\Program Files (x86)\Windows Kits\10\Vsix\VS2022\10.0.22621.0\WDK.vsix(WDK 19041 only has VS2019). It's a Visual Studio's extension.
According to this: https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware-winpc/windows-wdk-on-visual-studio-2017-community/fdbd2b44-e57a-4849-903d-04001205a764
WDK is not currently supported by visual studio 2017.
This is ridiculous

VSTOInstaller.exe error 0x8007007F The procedure entry point GetFileVersionInfoExW could not be located in the dynamic link library VERSION.dll

I've got VSTO project for Outlook, developed in VS 2012.
When I install it under Windows XP, where Visual Studio 2010 or later version is installed, I've got no problems.
When I install it by clicking .vsto file under Windows XP where no Visual Studio is installed, VSTOInstaller.exe fails with 0x8007007F error.
When I install it from command line (in fact it's the same)
"c:\Program Files\Common Files\Microsoft Shared\VSTO\10.0\VSTOInstaller.exe" /install file://.../OutlookAddIn.vsto
I get
The procedure entry point GetFileVersionInfoExW could not be located in the dynamic link library VERSION.dll
Windows installer 4.5, VSTO 2010 runtime are installed on the problem machine.
How to fix it?
Thanks.
Finally I suppose VSTO 2010 runtime downloaded from https://www.microsoft.com/en-us/download/details.aspx?id=48217 has a bug in VSTOInstaller.exe (version 10.0.60724.0).
Uninstalling it and reinsalling older version from distributive of VS 2015/2012/2010 (find file vstor40_x86.exe or vstor40_x64.exe) fixes the problem.
VSTOInstaller.exe from VS 2015 has version 10.0.50903.0 - it is OK.

Task could not find "AL.exe" TFS 2013

I'm using Windows 7 SP1 and Visual studio Ultimate 2013. TFS server 2013 is installed in Windows Server 2008.
Below error occurred while trying to build one solution which supports multilingual resx files:
C:\Program Files
(x86)\MSBuild\12.0\bin\amd64\Microsoft.Common.CurrentVersion.targets
(3001): Task could not find "AL.exe" using the SdkToolsPath "" or the
registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft
SDKs\Windows\v8.1A\WinSDK-NetFx40Tools-x86". Make sure the
SdkToolsPath is set and the tool exists in the correct processor
specific location under the SdkToolsPath and that the Microsoft
Windows SDK is installed
I have gone through similar questions, but those solutions didn't work. Few are given below:
Install Windows SDK
Windows SDK is already installed
al.exe is present in C:\Program Files\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
al.exe is present in \Windows\v7.0A\bin and v8.0A\bin\NETFX 4.0 Tools
Remove resx files and build
Resx files are part of the project and I want them to be in my build.
Any idea to fix this issue?
Thanks for your comments. I installed Windows SDK in server machine, where TFS is installed. It solved my problem.

why i don't have Microsoft.VC80.MFC-file?

Got a fresh Win7 machine with VS2005 installed. I tried to start a MyApp.exe that is built with manifest that says in Manifest.bin:
...
<assemblyIdentity type="win32" name="Microsoft.VC80.MFC" version="8.0.50727.4053" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
...
and the result was error message "The application has failed to start because it's side-by-side configuration is incorrect...
Event viewer told me the reason in detail:
Activation context generation failed for "c:\Xxx\MyApp.exe". Dependent Assembly Microsoft.VC80.MFC,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="8.0.50727.4053" could not be found. Please use sxstrace.exe for detailed diagnosis.
so I browsed the winsxs folder and indeed all "4053-folders" were missing. Then i edited Manifest.bin and replaced 4053 with 4927. The errors reocurred with different version. Then I found out that I got "4927-folder" for msvcr80.dll but no "4927-folder" for mfc80.dll.
Two questions:
-Why no "4927-folder" for mfc80.dll?
-How to get all "4053-folders" ?
Thanks & BR -Matti
You should either install Visual C++ redistributable or use merge modules to add the redistributables into your Windows Installer installation package. Or alternatively you should copy MFC libraries in the directory with your application.
Libraries that can be used as private assembly (in your app directory) are located in C:\Program Files (x86)\Microsoft Visual Studio 8\VC\redist\x86, or in amd64 if your app is 64 bit.
Merge modules for Windows Installer (MSI) are in C:\Program Files (x86)\Common Files\Merge Modules.
Redistributable package that installs all the libraries can be found in C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe for 32 bit programs and in …\vcredist_x64\vcredist_x64.exe for 64 bit programs. You can get these files from Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update.
And I think you want to update Visual Studio with this package Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update.

Resources