Where is the Visual Studio Macro for FrameworkSDKDir? - c#

There used to be a Macro for FrameworkSDKDir for .net apps in the Build Events tab. As mentioned on MSDN, that's:
The directory into which you installed the .NET Framework.
Now on Visual Studio 2015 on Windows 10, it's not in the Macros list. I verified, and I do have the Windows 10 SDK installed. The path should be C:\Program Files (x86)\Windows Kits\10\ . I know I can just hard code that value, but there's a reason for Macros…
So, is there some way to get it back?

Related

Set toolpath to MSBuild 2019 in a TFS 2013 using (XALM) build process templates

TL;DR: Clean Windows build server, MS Build Tools 2019 and TFS 2013 installed.
Build Logs says Exception Message: File not found: MSBuild.exe (type FileNotFoundException)
How Do I setup MSBUILD toolpath in a XAML file on TFS 2013, configured to use MSBuild 2019 with a Visual Studio 2019 Enterprise installed on my dev box.
Please provide FULL XAML file that WORKS with TFS2013 (update 3) with an explicit custom msbuild path.
A Bit more info:
We have a multi server setup for our TFS build routines running version 2013.
One controller and a few agent servers here and there, nothing fancy.
Recently I added yet another for GUI Testing - I need the agent service to be in Interactive mode.
Steps so far:
Installed TFS 2013 including two agents - linking to the main controller.
I install Build Tools version 2019
I added tags to control the build destribution.
Activated a build and the rest is history.
I'm four (frustrating) days in on this - I've read every Stack Overflow TFS set toolpath entry I can find, and a huge bunch of odd forums, yet none seems to scratch my itch here.
I even added both paths you see further down, to the Windows environment PATH variable. Im not sure that does anything anymore.
See; Everybody talks about this entry in the XAML that says toolpath (or similar) - but; I dont see it. We use a minor changed version of a TfvcTemplate.12.Xaml.
Many also talk about this GUI tool for editing XALM files, where I get to see all the different options available (I presume) - can someone help me with this too? Its certainly not working out of the box with a 2019 Enterprise????
So; I installed this Extension Process Template Editor, but of course nothing happens when I click a XAML file, just more XML :)
I now have a few added paths on the new server, where I see instances of msbuild.exe installed (MS/.NET get your act together, please)
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin
C:\Program Files (x86)\MSBuild\12.0\Bin
Please try not to write this off as a duplicate at first glance. I know its similar to other questions - however; Devil is in the details.
Set toolpath to MSBuild 2019 in a TFS 2013 using (XALM) build process templates
Just as you know, the Old Visual Studio versions installed msbuild into C:\Program Files (x86)\MSBuild\<version>\bin and apparently the RunMSBuild activity used the ToolVersion + the ToolArchitecture to calculate this path.
VS 2019 build tool instead installs it C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin and the RunMSBuild can't calculate the proper path anymore. You can not use the old DefaultTemplate12.xaml to integrate with VS2019 build tool.
To make this work, you could try to modify the TFSBuildServiceHost.exe.config and you must have a version of VS 2019 build tool or VS2019 installed on the build server in order for this to work.
More detail step please follow Jonesy2488's answer in this link:How to get VS 2017 working with TFS 2017 XAML Builds.
Besides, we could also try to use MSBuild task instead of Visual Studio Build task, then specify the location of MSBuild 16.0:
Hope this helps.
I made it work by changing ToolVersion for mtba:RunMSBuild in TfvcTemplate.12.xaml to the required version and adding MSBuildToolsPath to Windows Registry.
Registry settings for 15.0 and 16.0
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin\\amd64"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\16.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin\\amd64"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\15.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\MSBuild\\15.0\\Bin"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\16.0]
"MSBuildToolsPath"="C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin"

vs_buildtools.exe missing from Visual Studio Build Tools 2017

I installed the Visual Studio Build Tools 2017 using the link (at bottom under Other Tools and Frameworks) installing both workloads: Visual C++ build tools and Web development build tools. I kept the default folder.
Based on quite a few articles, such as Microsoft Web Application Targets is Missing, I expected to see vs_buildtools.exe in the folder: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin folder, but no. I see MSBuild.exe, as you can see from this screenshot.
Here is a screenshot of the installer.
Really, there are quite a few articles saying the exact same thing: 1, 2, to name only 2.
How do I get vs_buildtools.exe?
Apparently the only way to solve my Microsoft induced Web Application Targets missing problem, as it is no longer in 15.0 is to use this executable and run the vs_buildtools.exe --add Microsoft.VisualStudio.Workload.WebBuildTools as the answer specifies. I am also annoyed now that something that should be there is not. Did Microsoft change something in a newer revision of the Build Tools?
How do I get vs_buildtools.exe?
You have already got the vs_buildtools.exe.
I installed the Visual Studio Build Tools 2017 using the link (at bottom under Other Tools and Frameworks) installing both workloads
You will notice that the installed file name is vs_buildtools__339506979.1501125082.exe, which include the version info in the name. You can rename it to vs_buildtools.exe, that is what you want.
Update for vs_buildtools.exe:
After use the command:
vs_buildtools.exe --add Microsoft.VisualStudio.Workload.WebBuildTools
The WebBuildTools will be installed at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications
Besides, be aware that the comment under the answer:
If you already have downloaded the "Build Tools for Visual Studio
2017" installer
(visualstudio.com/thank-you-downloading-visual-studio/…), then you can
launch that installer, hit Modify and tick the "Web development build
tasks" workload module checkbox. Then click the Modify button and let
the installer finish.

visual studio does not recognize windows 10 sdk in version 10.0.14393.0

my Visual Studio does not recognize my Windows 10 SDK.
The steps to reproduce it:
Install VS 2015 Professional with update 3 and select the windows SDK for version 10.0.14393.0 as optional feature
Create an UWP App with this version
The following error is displayed in the output window:
error : The project requires a platform SDK (UAP, Version=10.0.14393.0) that is not installed. Please visit the following link for more information: http://go.microsoft.com/fwlink/?prd=12514&pver=14.0&sbp=PlatformSDKMissing&plcid=0x409&o1=UAP,%20Version=10.0.14393.0
Uninstall Windows 10 SDK 10.0.14393.0
Install Windows 10 SDK 10.0.14393.0 from the link provided in step 3
Create an UWP App with the version 10.0.14393.0 and the same error like in step 3 is displayed
further information: in the list of programs and features in the control panel the name of the sdk is:
Windows Software Development Kit - Windows 10.0.14393.795
and the version is
10.1.14393.795
My guess is that the version is wrong in the registry and therefore visual studio cannot find the sdk.
If I look under the path C:\Program Files (x86)\Windows Kits\10\Platforms\UAP I can see a directory named 10.0.14393.0 that contains a Platform.xml and a PreviousPlatforms.xml as it should.
Under the path C:\Program Files (x86)\Windows Kits\10\bin there is a directory named 10.0.14393.0 too so the SDK seems to be installed correctly
I already tried reinstalling of visual studio and several SKDs in different versions from VS or the online link and nothing worked. If I target another SDK Version like 10.0.10586 I am able to create the project.
Thank you for reading. I am thankful for every hint into the right direction.
Reinstalling Windows is not necessary. Modify the existing installation of VS2017 and remove the check next to Universal Windows Platform development, then go to the Individual components tab and select the Windows SDK 10.0.14393.
Click Modify.
Once finished, Modify the existing installation of VS2017 again and recheck the Universal Windows Platform development box and Click Modify.
Problem resolved and no restart required.
I had this same issue but resolved it by installing the .033 version rather than the latest .795. It is available on the SDK download page in the description of the SDK by clicking on the link behind 'QFE':
Windows 10 SDK (ver. 10.0.14393.795 – a QFE for 10.01.14393.033) and Microsoft Emulator for Windows 10 mobile
Also, even though it wasn't required, I uninstalled .795, then rebooted. Then installed .033 and then rebooted again prior to trying to open visual studio.
I'v already installed Windows SDK 10.0.14393.795 successfully. Then I create UWP project which targets 14393 successfully. So I could not reproduce your issue.
I already tried reinstalling of visual studio and several SKDs in different versions from VS or the online link and nothing worked.
If you have tried to repair your visual studio, but it still didn't work. You'd better use  http://aka.ms/vscollect to gather the installation logs. Find vslogs.zip from %temp% folder. Please upload the file and share the link here. I will help you find the root cause according to the log file.
The solution is to reinstall windows and make a clean install of Visual Studio. Somehow the system got messed up and not even a visual studio reinstall could help.

No templates in Visual Studio 2017

After a Visual Studio 2017 (RC) installation from scratch, I can't find a standard list of templates. I'm specifically interested in the Console Application (C#) template and the Windows Form (C#) template. I'm pretty sure I'm missing one of the Individual Components. I'm not sure which one is supposed to be installed and I don't want to install all of them.
Please see my list with components installed.
You need to install it by launching the installer.
Click the "Workload" tab* in the upper-left, then check top right ".NET-Desktop Development" and hit install. Note it may modify your installation size (bottom-right), and you can install other Workloads, but you must install ".NET-Desktop Development" at least.
*as seen in comments below, users were not able to achieve the equivalent using the "Individual Components" tab.
If you have installed .NET desktop development and still you can't see the templates, then VS is probably getting the templates from your custom templates folder and not installed.
To fix that, copy the installed templates folder to custom.
This is your "installed" folder
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\ProjectTemplates
This is your "custom" folder
C:\Users[your username]\Documents\Visual
Studio\2017\Templates\ProjectTemplates
Typically this happens when you are at the office and you are running VS as an administrator and visual studio is confused how to merge both of them and if you notice they don't have the same folder structure and folder names.. One is CSHARP and the other C#....
I didn't have the same problem when I installed VS 2017 community edition at home though. This happened when I installed visual studio 2017 "enterprise" edition.
I found the path and wrote it in the options
My personal experience was that I had installed the Team Foundation Server client for 2017 first (was using it as a Proof of Concept for our QA team, while I was still using VS2015), then followed it up with Installing Visual Studio 2017 later to begin development.
What I ended up with on my Start Menu was a Visual Studio 2017 and a Visual Studio 2017 (2). The Visual Studio 2017 (2) had all the templates I was missing. Following the steps found in the First answer to this question (which were clear and easy to follow) did not fix my issue. I had thought that launching the client would upgrade to the Development Client, but it did not. I renamed it to Visual Studio Professional, and now have everything I need. Not sure if this happens to anyone else, but it was what happened to me, so I hope this helps someone.
NOTE: this topic is about installation issues with MS project templates.
I came here via a search in Google, I was looking for a missing Template option in Visual Studio 2017 File menu: in VS-2015, it was Export to Template and I used it to add my own standard Project Items.
Meanwhile, I found an answer.. my issue was not related to default templates and it does not need install things. The option Export to Template has been moved to the VS-2017 Project menu !
I had to reinstall .NET desktop development (throught Workload tab), even button was showing: Modify
After that Visual C# selection appeared :)
(And now i can use Console APP Template)
In my case, I had all of the required features, but I had installed the Team Explorer version (accidentally used the wrong installer) before installing Professional.
When running the Team Explorer version, only the Blank Solution option was available.
The Team Explorer EXE was located in:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\devenv.exe"
Once I launched the correct EXE, Visual Studio started working as expected.
The Professional EXE was located in:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
My C++ templates were there all along, it was my C# ones that were missing.
Similar to CSharpie, after trying many modify/re-installs, oddly the following finally worked for me :
- run the installer, but un-select 'Desktop development with C++'.
- allow installer to complete
- run the installer again, and select 'Desktop development with C++'.
- allow installer to complete
In my case, I had all of the required features, but I had installed the Team Explorer version (accidentally used the wrong installer) before installing Professional.
When running the Team Explorer version, only the Blank Solution option was available.
The Team Explorer EXE was located in: "C:\Program Files (x86)\Microsoft Visual Studio\2017\TeamExplorer\Common7\IDE\devenv.exe"
Once I launched the correct EXE, Visual Studio started working as expected.
The Professional EXE was located in: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\devenv.exe"
This solved my issue, and the reason was I had enterprise edition previously installed and then uninstalled and installed the professional edition. Team Explorer was not modified later when I moved to professional from enterprise edition.

Convert C# project to .exe (visual studio 2010)

Is it possible to convert visual studio 2010 express project to .exe file? Yes I know that in Projects -> [FileName of the .sln file] -> Bin -> Debug is .exe file. But when I copy it to other directory/ hdd/ usb it do not work. My project includes .mp3 and .wav files.
You cannot just copy the exe. You need to copy all of the dependencies also. If you want to know which explicitly, you could run Fusion Log Viewer to see what is missing.
Use a compiler... like Inno Script Studio (https://www.kymoto.org/products/inno-script-studio). It's free and I've been using it for years. I'm not sure what the express version of Visual Studio has available, but I know the Visual Studio 2012 Professional version has InstallShield LE available which is very easy to use as well.

Categories