Error while deploying Window driver, Visual Studio 15, WDK - visual-studio

Has any one encountered this error while trying to deploy on a target machine?
Target seems to be provisioned properly.
Here's the log:
1>------ Build started: Project: umvirtualcamera, Configuration: Debug x64 ------
1> Building 'umvirtualcamera' with toolset 'WindowsUserModeDriver10.0' and the 'Universal' target platform.
1> Stamping x64\Debug\umvirtualcamera.inf [Version] section with DriverVer=06/02/2017,14.8.2.786
1> umvirtualcamera.vcxproj -> C:\Users\xxx\Repo\lessquitos\ee\projects\sortcamera\vs\umvirtualcamera\umvirtualcamera\x64\Debug\umvirtualcamera.dll
1> umvirtualcamera.vcxproj -> C:\Users\xxx\Repo\lessquitos\ee\projects\sortcamera\vs\umvirtualcamera\umvirtualcamera\x64\Debug\umvirtualcamera.pdb (Full PDB)
1> Driver is a Universal Driver.
1>C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets(1264,5): error MSB6004: The specified task executable location "C:\Program Files (x86)\Windows Kits\10\bin\x86\inf2cat.exe" is invalid.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

According to this page, you can restore the files by following instructions.
I got my Inf2Cat.exe back by this way.
https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit
Important: If you have installed WDK for Windows 10, version 1607,
some WDK files get removed when installing the WDK for Windows 10,
version 1703 on top of the WDK for Windows 10, version 1607. To
restore these files:
On the Start menu, enter Apps & features in the search box, and
select Apps & features from the results.
Find Windows Driver Kit -
Windows 10.0.15063.0 in the list of Apps & Features, and then select
the program.
Select Modify, select Repair, and then follow the
directions on the screen.
The files will be restored.

I had the same issue when I was building my V4 Printer driver package in VS2017. I just went through the following steps and it solved finally:
1- Right-click on your project (in my case that was a packaging project) and select "Properties".
2- Select General then in the options select "Windows SDK Version"
3- Change it to the proper version (in my case that was "10.0.17763.0"): Just for information, use a tool like "Search Everything" to find all instances and locations of your desired file. This helps to clearly see where those files really exist or not (in my case I need two files: "inf2cat.exe" and "stampinf.exe").
4- Press OK
5- Rebuild your project.
I hope this helps you.
PS: Sometimes changing the value of "Platform Toolset" at the same window to another value does the same (in my case changing the value of this option from "WindowsUserModeDriver10.0" to "Visual Studio 2017 (v141)" did same change as mentioned above)

I think it is already not required to provide an answer, but at the same time, I constantly have the same error when I try, for example, to build a driver from MS samples that are from WDK that targets Win 10.
The only solution that I apply is to set appropriate version of Windows SDK Version property that can be found: {Project Properties} >> General >> Windows SDK Version.
This is well known place.
In my case I have the following items in the drop-down list:
10.0.15063.0; 10.0.16299.0; 10.0.17763 and finally 8.1;
VS About dialog indicates the version of WDK: 10.0.16292.1001;
Platform Toolset: WindowsUserModeDriver10;
The only successful solution for getting project built is to set Windows SDK Version to 10.0.16299.0.
The error disappears in such case and signing a driver completed successfully either for test mode or production one.
I hope my answer will be helpful.

Related

Unable to build a freshly created Xamarin Cross-Platform project with MsBuild

Here the repro steps:
Start VS 2017
Create a cross-platform project ==> Sample.sln
Build it in VS ==> Ok
By building with it with the command "msbuild Sample.sln" I get 4 times the following error message: error MSB4066: The attribute "Version" in element "PackageReference" is unrecognized.
Anything missing in the .csproj files I am supposed to add?
Thanks in advance for your support.
Make sure that you use the path to msbuild.exe that is installed with Visual Studio. Use the Developer Command Prompt for Visual Studio 2017 if unsure, it has the PATH set up so that msbuild will point to the right executable.
This error happy when you use an old version of MSBuild (e.g. the version included in .NET Framework) that doesn't support the necessary features - metadata as attributes in this case.

Visual Studio 2015 does not build my (blank) Cordova projects: Build fails without error

I am using Visual Studio Enterprise 2015 to create Cordova projects. The project gets created successfully and I am able to play around with the source code. Before I actually change something and I try to build the empty starting project, Visual Studio will give me the following build message:
1>------ Build started: Project: BlankCordovaApp4, Configuration: Debug Android ------
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
The error List is completely empty and I cannot see anything in other output windows nor the command window.
I have looked around to activate the diagnostic log level when building (Tools > Options > Projects and Solutions > Build and Run > MSBuild output verbosity) but that didn't help... I'm still seeing the same non-descriptive message.
I am on Windows 10 with the following programs installed:
Node JS 4.0.0
Cordova installed with the npm tool (npm install -g cordova)
Android Studio and its Emulators
Visual Studio 2013 Ultimate Update 4
Visual Studio 2015 Enterprise Edition (with Cordova Tools)
I have been successfully creating Cordova apps with Visual Studio 2013 with the tools and with Visual Studio 2015 RC. But I can't seem to make it work anymore in the current build.
I have tried Repairing Visual Studio as well as uninstalling and reinstalling it completely, without avail. I have also cleared the Cordova cache multiple times and tried to run Visual Studio from Administrator mode, but that didn't work either.
So the question actually is twofold:
Is there a way to see what actually is going wrong when I'm trying to build?
Has anybody else experienced this kind of issue and found a solution for it?
We connected to Diedrik's machine and debugged the problem. There is a bug in Visual Studio which we will fix shortly.
For now, here is a workaround:
Open Tools -> Options -> Tools for Apache Cordova -> Remote Agent Configuration
Set Enable remote iOS processing to “False”
Click OK
(Optional if remote build is needed) Re-open the options and set it back to “True”
Thank you for reporting this problem!
I have experienced it and I fixed it closing everything and restarting windows after that it hasn't happened again, I think Visual Studio 2015 has a bug or something
In my case, I was having the same issue after upgrading VS 2015 RC to Enterprize. I then run the installer again and this time selected Cordova Update 4 rather than 3 which was selected by default. After install completed, I was able to build Cordova apps successfully. Didn't have to change anything in remote iOS processing.

How to install SignTool.exe for Windows 10

How to install SignTool.exe in Visual Studio 2015 for Windown 10?
I tried to build my project but the program threw an error :
Error An error occurred while signing: SignTool.exe not found.
You need to install the Windows 10 SDK.
Visual Studio 2015 Update 1 contains it already, but it is not installed by default. You should go to Control Panel -> Programs and Features, find Microsoft Visual Studio 2015 and select "Change".
Visual Studio 2015 setup will start. Select "Modify".
In Visual Studio components list find "Universal Windows App Development Tools", open the list of sub-items and select "Windows 10 SDK (10.0.10240)".
Windows 10 SDK in VS 2015 Update 1 Setup
Of cause you can install Windows 10 SDK directly from Microsoft: https://go.microsoft.com/fwlink/?LinkID=698771
As josant already wrote - when the installation finishes you will find the SignTool.exe in the folders:
x86 -> c:\Program Files (x86)\Windows Kits\10\bin\x86
x64 -> c:\Program Files (x86)\Windows Kits\10\bin\x64\
If you only want SignTool and really want to minimize the install, here is a way that I just reverse-engineered my way to:
Download the .iso file from https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk (current download link is http://go.microsoft.com/fwlink/p/?LinkID=2022797) The .exe download will not work, since it's an online installer that pulls down its dependencies at runtime.
Unpack the .iso with a tool such as 7-zip.
Install the Installers/Windows SDK Signing Tools-x86_en-us.msi file - it's only 388 KiB large. For reference, it pulls in its files from the following .cab files, so these are also needed for a standalone install:
4c3ef4b2b1dc72149f979f4243d2accf.cab (339 KiB)
685f3d4691f444bc382762d603a99afc.cab (1002 KiB)
e5c4b31ff9997ac5603f4f28cd7df602.cab (389 KiB)
e98fa5eb5fee6ce17a7a69d585870b7c.cab (1.2 MiB)
There we go - you will now have the signtool.exe file and companions in C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64 (replace x64 with x86, arm or arm64 if you need it for another CPU architecture.)
It is also possible to commit signtool.exe and the other files from this folder into your version control repository if want to use it in e.g. CI scenarios. I have tried it and it seems to work fine.
(All files are probably not necessary since there are also some other .exe tools in this folder that might be responsible for these dependencies, but I am not sure which ones could be removed to make the set of files even smaller. Someone else is free to investigate further in this area. :) I tried to just copy signtool.* and that didn't work, so at least some of the other files are needed.)
Here's where you'll find it:
C:\Program Files (x86)\Windows Kits\10\App Certification Kit
Screenshot:
Best solution end of 2020:
Just download Windows 10 SDK from Microsoft here:
https://go.microsoft.com/fwlink/?LinkID=698771
In setup, choose only Windows App Certification App (it's only 184 MB)
You can find signtool.exe here:
%PROGRAMFILES(X86)%\Windows Kits\10\bin\x64
Cheers!
As per the comments in the question... On Windows 10 Signtool.exe and other SDK tools have been moved into "%programfiles(x86)%\Windows Kits\".
Typical path to signtool on Windows 10.
32 bit = "c:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe"
64 bit = "c:\Program Files (x86)\Windows Kits\10\bin\x64\signtool.exe"
Tools for SDK 8.0 and 8.1 also reside in the "Windows Kits" folder.
Another answer from 2021.
You might not need Windows SDK at all. If you have VS-2019 installed, you might already have signtool in C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool\signtool.exe
NOTE: The good thing about this particular signtool version (compared to the Windows SDK one), is that it's self-contained, and does not need all the dll's next to it (mssign32.dll, wintrust.dll etc, which usually lie around in Windows SDK folders).
You can even add this file to your source code repo (just one file), since this tool hasn't changed since 2016.
P.S. I had this signtool even without "ClickOnce publishing" component installed in my Visual Studio Community Edition.
Location:
C:\Program Files (x86)\Windows Kits\10\App Certification Kit\signtool.exe
In 2019, this is a quite recent link from Microsoft about how to obtain this tool:
The SignTool tool is a command-line tool that digitally signs files,
verifies signatures in files, or time stamps files. For information
about why signing files is important, see Introduction to Code
Signing. The tool is installed in the \Bin folder of the Microsoft
Windows Software Development Kit (SDK) installation path.
SignTool is available as part of the Windows SDK, which you can
download from https://go.microsoft.com/fwlink/p/?linkid=84091.
I only needed signtool, so I chose the minimal I came up with and signtool.exe is now in C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe
Microsoft article link:
https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool
to install just the signingtools from the winsdksetup.exe (available at the same url as the windows sdk iso mentioned above) this is an option to, straight from the Dockerfile i'm working in:
RUN powershell Start-Process winsdksetup.exe -ArgumentList '/features OptionId.SigningTools', '/q', '/ceip off', '/norestart', -NoNewWindow -Wait
so if you're in windows then that'd be:
winsdksetup.exe /features OptionId.SigningTools
winsdksetup /h gives you the options, so i won't summarise them here.
I include the dockerfile snippet, as that is what i started my day looking for the solution for.
You don't have to install the Signtool. It might already be there.
Go to C:\Program Files (x86)\ and search for signtool.exe. In my system I found it under C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool
No matter which version of Windows you are using, the above signtool will solve your purpose.
If you're using VS Express 2015, just go to your control panel --> programs and features --> select vs 2015 --> click change, then in the VS Express installer select 'Modify' --> select Publishing tools, and finish. Once setup completes the changes you will be able to create your installer.
You should go to Control Panel -> Programs and Features, find Microsoft Visual Studio 2015 and select "Change".
Visual Studio 2015 setup will start. Select "Modify".
In Visual Studio components list, open the list of sub-items and select "ClickOnce Publication Tools" and "Windows 10 SDK" too.
I did a modify with the Visual Studio from Control Panel, Programs and Features. The SDK was not at first apparent so I installed the Common Tools which lo and behold did include the SDK Update 3.
It's available many, many places, depending upon what is installed:
On my box, every one except the v6.0A SDK version supports the /fd option.
SignTool is available as part of the Windows SDK (which comes with Visual Studio Community 2015). Make sure to select the "ClickOnce Publishing Tools" from the feature list during the installation of Visual Studio 2015 to get the SignTool.
Once Visual Studio is installed you can run the signtool command from the Visual Studio Command Prompt.
By default (on Windows 10) the SignTool will be installed in:
C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe
For me in 2021 the signtool.exe was here: "C:\Program Files (x86)\Windows Kits\10\bin\x64" or in: x86
and not under: C:\Program Files (x86)\Windows Kits\10\App Certification Kit
even if I have this folder and may files in it.
I ran into an issue using this tool in a restrictive Azure DevOps Pipelines environment, where I couldn't even expand PATH or call any tools from an absolute path outside of the ADO build directories, meaning in this case anything from C:\Program Files (x86)\
My solution was to package it as a Secure File in ADO Pipelines' Library -> Secure Files section, allow my pipeline to access the file via its security settings, then download it as a build task and run it via a powershell task.
In the example below, I just query the help with the /? command. Just replace that with whatever command you want to use.
- task: DownloadSecureFile#1
displayName: "Signtool Download"
name: MSSignTool
inputs:
secureFile: 'signtool.exe'
- task : PowerShell#2
displayName: "Run Signtool"
inputs:
targetType: "inline"
script: $(MSSignTool.secureFilePath) /?
Warning 1: I'm not sure what dependencies are required for signtool.exe to work standalone, or if it even has any. The Windows 10 SDK and ADK was already installed in this build environment. If querying the help causes the tool to fail or crash, make sure one or both of those are installed. Hopefully you will have access to something like choco to install any missing dependencies.
Warning 2: Be careful if copying those code segments. ADO is pretty strict with dynamic whitespace, so if your spacing is off it will brick your whole pipelines file until you adjust the spacing to its correct position.

Failed to locate: "CL.exe", Opencv with Visual studio c++ 2010 express program error

I have tried a lot of tutorials regarding configuring opencv 2.2 or 2.3 with MVS 2010 express C++, I tried also uninstall and reinstall my MVS 2010 to sure that it is working. Moreover I also configured it with opencv, like creating property sheets (DEBUG & RELEASE) and then set the Additional dependencies, libraries,includes, etc.
But when trying to run a simple program (Like displayin a video), I get this error:
1>------ Build started: Project: wew, Configuration: Debug Win32 ------
1>TRACKER : error TRK0005: Failed to locate: "CL.exe". The system cannot find the file specified.
1>
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Has anybody experienced the same problem and solved it?
I encountered this while installing React Native via npm. I solved it by following the advice in this post: Visual studio doesn't have cl.exe
Visual Studio 2015 doesn't install C++ by default. You have to rerun
the setup, select Modify and then check Programming Language -> C++
I assume it would work for older versions of Visual Studio as well.
I encountered this error today and my problem was that I had accidentally overwritten the "executable directories" part of the project's property pages. I.e. I overwrote the (common properties->VC++ Directories->Executable directories) entry.

Visual Studio 2010 cannot build projects

I have a weird problem.
I just installed visual studio 2010 RTM on windows 7 Ultimate. I have two problems!
1) File->New Project returns empty templates. Cannot create a project. But if I open a solution I can add project in the solution.
2) I cannot build the project! No matter what I tried build project returns only
------ Build started: Project: WindowsFormsApplication1, Configuration: Release Any CPU -----
========= Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
It only creates *vhost.exe files but not the exe. I tried to set detailed output in build but the same message appears. Even Cleaning the project does the same thing
I installed and reinstalled VS2010 several times. I installed it as Administrator and I also put "Everyone" to be allowed in the VS2010 install folder. My other co-workers installed it correctly from the same DVD.
can someone help me?
thanks
so the only solution was to format my system and re-install windows 7 :(

Resources