How to install SignTool.exe for VS 2017? - visual-studio-2017

After upgrade to VS 2017 i got
"Error An error occurred while signing: SignTool.exe not found."
But only using MSbuild on the Visual Studio publish there's no problem.
I already checked folder
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin"
and in fact there's no SignTool.exe present.
But there was before installing VS2017, any ideas?
I followed this issue but no luck
How to install SignTool.exe for Windows 10

Signtool is included with the Windows 10 SDK
Open Visual Studio installer.
Switch to the "Individual Components" tab
Choose the version of the SDK that suits your needs.
Multiple copies may be installed.

Start Developer Command Prompt for VS 2017 then it is in the path variable
signtool
That seems to do the trick, now the problem is with setup.bin file.
error MSB3147: Could not find required file 'setup.bin' in csproj folder

C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool>
This is where its there in my System.

The all solutions didn't worked for me ; finally i just copied signtool.exe to the project folder and then worked. You can download the signtool.exe from internet or install Windows 10 SDK by visual studio installer and then copy from "C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool".

I found it under C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
It could be because it was there before the vs2017 installation.
It doesn't harm to check :)

So the problem I had with this was that the path variable wasn't set up. I ran
set PATH="C:\Program Files (x86)\Microsoft SDKs\ClickOnce\SignTool";%PATH%
in the Developer Command window before trying to sign anything.
If you do it this way you will need to run the set path every time you want to use it unless you add it to the path environment variable.
I hope this helps.

Related

"The package System.Net.Http with version 4.1.1 could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\."

I am trying to evaluate a software SDK for displaying PDF files. It comes with a few sample projects, but I am having problems building the C++ projects. I am pretty sure this is a problem with my local environment, but I have no idea how to fix it:
The projects come as a Visual Studio solution, to be used in Visual Studio 2017. Upon first opening it I was told to install missing features (VS17 was a plain install with no workloads before):
After installing that, and twiddling with platform toolset and the general platform target settings, I could finally build the C++ library part that creates a .dll file to be used by the other 2 C++ projects. (I could also confirm that this works fine, as the also included C# project used the library perfectly fine.)
But for the 2 remaining C++ projects I get this error on build:
The package System.Net.Http with version 4.1.1 could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\. Run a NuGet package restore to download the package.
FunctionDemo
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets
377
Unfortunately I have no idea what "Use NuGet Package Restore to download them." means in that context - both the solution and all the projects have nothing listed when using Manage NuGet Packages... in Visual Studio. So I don't even know where this dependency comes from. (Are those part of the general SDKs I have installed maybe?)
Double clicking the error message opens C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets with this:
<ResolveNuGetPackageAssets Condition="Exists('$(FrameworkInjectionLockFile)')"
NuGetPackagesDirectory="$(FrameworkInjectionPackagesDirectory)"
RuntimeIdentifier="$(NuGetRuntimeIdentifier)"
TargetMonikers="$(NuGetTargetMonikerToInject)"
ProjectLockFile="$(FrameworkInjectionLockFile)">
But I guess this is pretty standard. Does this tell me something where the error comes from?
On the filesystem C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\System.Net.Http\4.1.1 indeed does not exist. Any tries to fill it manually (download the nuget package manually to a project, and copying the results here, using any solutions or commands to run I can find online) failed.
If found out that C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ is the package source Microsoft Visual Studio Offline Packages which I can view via Options -> NuGet Package Manager -> Package Sources in Visual Studio 2017, but disabling it there didn't change anything about the error message.
Am I looking in the wrong place?
Is this really my local problem or a project problem?
How can I fix this problem?
I "fixed" this by getting the C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\System.Net.Http\4.1.1 folder from another developer. Then the error message switched to other packages, so in the end he sent me his full C:\Program Files (x86)\Microsoft SDKs\NuGetPackages and I copied folders over until it finally built.
Still not idea what caused this, must have been a missing payload or SDK that Visual Studio thinks was installed but really wasn't :/
Keeping the question unanswered though in the hopes that someone comes along that know the real fix.
This happened to me after upgrading from Visual Studio 2017 to 2019. While not the same file, my error was:
error APPX0702: Payload file 'C:\Program Files (x86)\Microsoft
SDKs\NuGetPackages\System.Private.ServiceModel\4.1.3\runtimes\win7\lib\netcore50\System.Private.ServiceModel.dll'
does not exist.
For whatever reason, after upgrading, both VS 2017 and VS 2019 were looking for this in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages..., but I found it actually existed in the similarly named folder C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages... instead. I assume during the installation of VS 2019 this directory was created?
I manually copied the files over to where it was looking and then the build finally worked. The underlying issue isn't fixed, but maybe somebody smarter than me can explain why this happened in the first place.
For me disabling C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ didn't work either. But then I had deleted it from Nuget.Config and it had finally solved the problem.

fxc.exe not found by VS2017 in windows 10

I'm going to use the HelixToolkit.SharpDX with VS2017 in my Windows 10 workstation, when I attempt to build the solution, it will prompt the Assertion Failed error with "No fxc.exe found".
I have checked the installation option, Windows SDK has been included, nand I have downloaded and install again, and I can see the fxc.exe in "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64" & "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86" folders, so it should be available for any windows version, but unfortunately, the same error reported.
However, I have also installed VS2017 in another Windows 7 machine, it works fine, and it has the fxc.exe in the same folder as my Windows 10 workstation, but it can be located by VS2017.
Is there any setting in VS2017 to locate the fxc.exe?
Or how can I fix this issue?
Copy fxc.exe in Bin\10.0.xxx\x86 to Bin\x86 to fix this issue. Because the HLSL compile tool hard coded the path.
One can find solution on helix toolkit github page.
Visual Studio 2017. Windows 10 SDK.
Missing fxc.exe issue with newest Windows 10 SDK:
Copy fxc.exe in C:\Program Files (x86)\Windows
Kits\10\Bin\10.0.xxx\x86 to C:\Program Files (x86)\Windows
Kits\10\bin\x86 to fix this issue. Because the HLSL compile tool hard
coded the path.
This seems to have been fixed in Visual Studio 2019 16.0.2, as of writing. Just have to make sure $(WindowsSDK_ExecutablePath) is pointing to the correct SDK directory and the build version that matches with the Targeted Platform in the Project Properties page.
https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/a3032567-d8e7-4b01-81b7-0612047a6299/why-do-we-need-to-copypaste-fxcexe-from-bin100xxxxx0x86-to-binx86-directory-in-the?forum=windowssdk
Second post answered:
The executables that the C++ build process uses from the Windows SDK directory are MIDL.exe, MT.exe and RC.exe. If you digitally sign your executables then you will find signtool.exe here too. So I am kind of surprised that it finds some critical build tools correctly but others it fails to find.
My suggestion would be:
1) Verify that you are having this problem with your project in Visual Studio 2019 16.0.2 (the latest version at the time of writing) or Visual Studio 2019 Preview (16.1 Preview 1 at the time of writing). This is to check that if this has been found to be a bug, then it could have been fixed.
2) Create a completely new project. Without touching the project's executable path, try to create a sample that shows this behaviour. It doesn't need to be a full sample, just complete enough to show that Visual Studio fails to find fxc.exe.
3) If doing all of this shows that Visual Studio fails to find fxc.exe, then through Visual Studio 2019, report it as a bug.
But I will mention that a naïve test on my end shows that Visual Studio 2019 can compile HLSL shaders without any issues using the 18362, 17763 and 17134 SDKs. These were tested because these are the versions that I have installed.

VCVARSALL.BAT for Visual studio 2017

What is the location of file:
VCVARSALL.BAT
for Visual studio 2017?
To summarize, sth along the lines of
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
or
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\vsdevcmd" -arch=x64
(try running it with -help)
My environment:
** Visual Studio 2017 Developer Command Prompt v15.0.26403.7
on Win10 x64
Hans Passant is right.
I had the same problem: no VCVARSALL.BAT for my VS2017 and no Build folder in Microsoft Visual Studio\2017\Community\VC\Auxiliary.
I have Visual Studio Community 2015 and 2017 installed on the same machine.
I didn't have Desktop development with C++ check in my installation. I installed it and the Build folder was created!
Now everything work great.
VS2017 has reworked its directory structure and filenames. You should look for the file 'vcvars.bat', which can be located in "..\Program Files (x86)\Microsoft Visual Studio\2017\EDITION\Common7\Tools\vsdevcmd\ext\vcvars.bat" (replace EDITION with the version of Visual Studio you use).
For simplicity, you can use "%VSAPPIDDIR%" in your call to point to the IDE folder where devenv.exe is located, and go back one folder to define your path to the batch file. For example:
call "%VSAPPIDDIR%..\Tools\vsdevcmd\ext\vcvars.bat"
The VC folder is within the Desktop development with C++ workload. Go to your add or remove programs and modify your Visual Studio 2017, and choose it as shown below:
click on Modify (or Install/Setup in other devices). Go check your folder *\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build* and you'll see the the vcvars64.bat.
I had the same problem - was fixed by removing and reinstalling latest version of microsoft office (2017-2019) resolved the issue. The folder should exist in your MS path automatically, if its not there, uninstall and redownload and install - on my system takes around 3 hours.

Can't get visual studio C++ include file 'excpt.h' to get installed

I'm trying to compile a visual studio C++ project and I can't get anywhere because of the compiler reporting "Cannot open include file: 'excpt.h': No such file or directory". The problem has been reported numerous times on the Internet but I can't find any help regarding my particular situation. The problem is not that the include path of the project are not correctly setup, the problem is that this include file (and probably a bunch of other files) are just missing from my computer. There is no such file on my hard drive. So I tried installing Windows SDK 7.1. The file is not inside the installed SDK (although it should be). I tried repairing the install, uninstall it, reinstall it... all numerous time. I also try to install, repair, uninstall, reinstall Visual Studio 2010 professional numerous time, with and without the Windows SDK installed. I even tried uninstalling the professional version to install the express VC++... nothing seems to work, no 'excpt.h' never get installed on my computer. I am clueless... someone has a hint of a solution? I'm on Windows 7.
As supplementary information, note that 'excpt.h' is included in by "windows.h". Also, the "excpt.h" file is normally installed with the Windows SDK under a path like "c:\program files (x86)\microsoft sdks\windows\v7.1\include\" and with Visual Studio under a path like "C:\Program Files\Microsoft Visual Studio 10.0\VC\include\".
EDIT: If it might help, I might add that the folder C:\Program Files\Microsoft Visual Studio 10.0\VC\include related my Visual Studio install has only two files... which is certainly not normal!!! However, I can't find any ways to get the installer to install all the .h files that should appear in this repertory.
See if you have it at C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\excpt.h Check to be sure that the system include-paths are correct in Visual Studio. If all else fails, uninstall everything, all SDK's, etc., and re-install Visual C++.
Third party search programs do a better job than the Windows one for finding things. Try Agent Ransack. It's free.
For those who have the same problem, here is the solution I found after about 10h of install/uninstall/cleaning cycles... I've uninstalled completely visual studio using this. After that, using the control panel, I've uninstalled the Windows SDK and everything that can be associated with it or with visual studio (e.g. .NET framework). Then, I've removed all the left overs by manually deleting the visual studio and the Windows SDK folders located in C:/Program files. Finally, I deleted all the entries related to the Windows SDK or to Visual Studio in the registry (they are located in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft). Then, I reinstalled Visual Studio... and it was finally working correctly. I should add that I restarted and cleaned the registry using CCleaner after any install or uninstall step.
I had this problem with a project that had been updated to VS2017 from VS2015.
This was a header included via windows.h. I knew this header should have no problems as I had other projects created directly in VS2017 that used windows.h.
Another symptom was that the intellisense was highlighting includes of standard headers (e.g string, vector etc), although these were not generating compile errors.
The fix for me was similar to VS 2010 Cannot open source file “string”.
Initially, I retargeted the project, hoping this would help (right-click the project, select retarget projects), but this did not in itself cure the problem.
I then took a working project and copied the include directories from project properties->Configuration Properties->VC++ Directories and used these to replace the same property for my broken project. This fixed the problem.
Initially, the value for this property was
$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSDK_IncludePath);
The replacement value was
$(VC_IncludePath);$(WindowsSDK_IncludePath);
I had the same problem, and tried the answer given by OP, but it did not work. However, copying the contents of C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC (specifically bin, lib, and include) from a machine that did work to this machine worked.
It seems the Visual Studio 2012 installer is buggy when it comes to installing into a different drive letter than C:. I have installed the VS2012 into the D: drive and got the same error. I found that for some unknown reason the installer put some of the files into the correct location at:
D:\Program Files (x86)\Microsoft Visual Studio 11.0
but the remaining files were at
C:\Program Files (x86)\Microsoft Visual Studio 11.0
so I have moved the files from the C: into the D: location and it fixed the problem.
Some situation cause such problem. If you have uninstalled vs2010. you lost platform C++ binaries for .net framework 4 forever. You have to delete all of VS 2010 2012 2013, clean system up and its accompany components and reinstall them from scratch.
Or you can download this package. Include them in your project that may solve your problem properly.
one simeple way,just copy vc directory(C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC) from other computer
Fixing your Visual Studio installation is a good idea, but you don't necessarily need to re-install the same old version of VS. I uninstalled VS 2015, then modified my VS 2017 installation to add the VC++ v140 build tools, and now my project builds.

Building Boost - can't find windows.h

I'm trying to build boost on windows 7 64-bits. Running bootstrap gives
execnt.c(29) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
and some others. I have visual studio 9.0 and the places where I have windows.h is in
C:\Program Files (x86)\Microsoft SDKs\Windows\v5.0\Include**W**indows.h, with capital W
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include**W**indows.h
C:\Program Files (x86)\Microsoft Visual Studio 9.0\SmartDevices\SDK\Smartphone2003\Include\windows.h
I have the SDK installed and even fully reinstalled Visual studio. Any way I can fix this?
Small update: I installed Visual C++ 2010 express and from the IDE I can include and the test project compiles just fine, but when I use the prompt NO projects can find the header
Try running the boost build from a VS console rather than trying to run 'cmd'. It's probably somewhere in the start menu entry for VS (used to be anyway). It used to also be available from VS itself under tools, but I think they removed it there.
This version is just cmd, but it runs a batch script that sets a bunch of very important environment variables.
For future reference of anyone looking for the same error
I have installed visual studio without registry edition permission, so I had none of the environment variables set, those that boost libraries / libxml2 et al look for when calling the cl compiler
Giving myself permission to edit the registry and uninstalling/reinstalling all visual studio related programs solved it
Edit %VS90COMNTOOLS%vsvars32.bat with administrator privileges any way you like, eg.
runas /user:Administrator "notepad %VS90COMNTOOLS%vsvars32.bat"
Find the section
:GetWindowsSdkDirHelper
#for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows" /v "CurrentInstallFolder"') DO (
if "%%i"=="CurrentInstallFolder" (
Change it to
:GetWindowsSdkDirHelper
#for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0a" /v "InstallationFolder"') DO (
if "%%i"=="InstallationFolder" (
When you install a newer version of the Windows SDK, it updates HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\CurrentInstallFolder to point to the newer version.
Unfortunately, the batch file that Visual Studio 2008 uses to set its paths uses this registry key to identify the location of the Windows SDK, so instead of pointing at the version of the Windows SDK that works with VS2008 (6.0a), it points to the the latest version to be installed.
Editing the registry is one option. A better option is to change the batch file so that it gets the right path from the registry, as above.