Visual Studio 2017 doesn't see SDK - visual-studio

I have Visual Studio 2017 Community Edition; along with a bunch of SDKs:
> dir "C:\Program Files (x86)\Windows Kits\10\Include"
10.0.10150.0
10.0.10586.0
10.0.15063.0
10.0.17134.0
10.0.10240.0
10.0.14393.0
10.0.16299.0
10.0.17763.0
However, "Командная строка разработчика для VS 2017" (VsDevCmd.bat) doesn't see my SDK. Environment variables:
IFCPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ifc\x86
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Windows\Microsoft.NET\Framework\v4.0.30319;
resulting in
fatal error C1083: Не удается открыть файл включение: sys/types.h: No such file or directory
on compilation with cl.exe.
Are any additional steps needed to configure SDKs for Visual Studio 2017?

Quite unexpectedly, the problem was in
C:\Windows\System32
missing from PATH.
set VSCMD_DEBUG=3
helped to pin down the issue.

Related

Visual Studio 2017 msbuild package sharepoint

I have a simple SharePoint 2013 solution which I can publish through Visual Studio - this will generate .wsp for me. However when I am trying to run build by the command:
msbuild /t:Package mySolution.sln
Build is ok but during packaging I receive an error:
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.targets(190,5): error : Could not load file or assembly
'Microsoft.VisualStudio.Modeling.Sdk.15.0, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its
dependencies. The system cannot find the file specified.
If I put this missing dll to C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools then I receive another error about another missing dll...
What am I doing wrong?
Looks like this is MSBuild issue:
1.Open elevated command prompt
2.Navigate to your SDK tools
cd "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64"
Sn -Vr "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.Modeling.Sdk.15.0.dll"
For the following three dlls, please do same behavior from step 3 to 4
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.SharePoint.dll
Note if Microsoft.VisualStudio.SharePoint.dll not found in above path, check in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\SharePointTools\Microsoft.VisualStudio.SharePoint.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.SharePoint.Designers.Models.Features.dll
Now you can MSBuild your SharePoint 2016 solutions by VS command promp.
Check Link, that's for Sharepoint 2016, but same works for 2013 as well: https://developercommunity.visualstudio.com/content/problem/40195/cant-use-msbuild-to-package-sharepoint-2016-soluti.html

Where is the Microsoft Visual Studio Community executable located?

I just installed it but I don't know where it is. Can anyone help me? I've looked in a lot of places but I still don't know.
Look for devenv.exe, it should be at:
Visual Studio Community 2015
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
Visual Studio Community 2017
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE
Visual Studio Professional 2017
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE
For VS2019 it's now at:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe
I would say instead of looking at a predefined location for the installation which might change in future what you should do is as follows -
Search for visual studio in apps search
Right click and select "Open file location"
Once you have this shortcut, Right click on it and select and open properties and see the target field. This is your executable path.
For me it is -
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe"
Due to this link https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/how-to-set-environment-variables-for-the-visual-studio-command-line
Visual Studio location could be
\Program Files\Microsoft Visual Studio\Version\Offering or
\Program Files (x86)\Microsoft Visual Studio\Version\Offering
where Offering is one of Enterprise, Professional or Community, Version is 2019, etc
For VS 2022 it's now at (Program Files not Program Files x86):
C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE
For VS 2020
"C:\Users\Username\AppData\Local\Programs\Microsoft VS Code\Code.exe"

Does Visual Studio 2015 have float.h?

I may be going crazy here.
Visual Studio 2013 has float.h located at
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\float.h
There are references to float.h in the MSDN docs for Visual Studio 2015.
Yet in the directory Visual Studio 2015 is located at, there's no float.h:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\float.h (doesn't exist)
Has it been removed?

Missing Clickonce prerequisites in Visual Studio 2013

I have installed Visual Basic PowerPacks 10.0. It appears as a Clickonce Prerequisite in Visual Studio 2010 but in Visual Studio 2013 Professional It has the yellow triangle next to it and an error is generated when I build my project.
Any help appreciated.
I found a work around. I went to the bootstrapper directory located here:
C:\Program Files (x86)\Microsoft SDKs\Windows\
Visual Studio 2013 looks here for the bootstrapper packages: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Inside C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\ I found the VBPowerPacks folder and copied it to C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\
Not sure why VBPowerPacks does not automatically install in all Bootstrapper folders. That would have saved me a great deal of time.

How to debug x64 with Visual Studio?

I'm trying to create my first Silverlight application. It seems that it can't be debugged because Visual Studio 2010 uses the x86 'Remote Debugger'. It that I also have the x64 bit version installed in:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64
But I can't find how I'm supposed to make VS 2010 use
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x64
instead of
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86
Thank you.

Resources