Visual Studio 2022: System.InvalidOperationException: "git" is not present in PATH - visual-studio

I'm trying to compile the following project:
https://github.com/xoofx/markdig
In Visual Studio 2022, How to resolve the error message:
System.InvalidOperationException: "git" is not present in PATH.
What's the correctly way to install 'git' for visual studio? I thought Visual Studio Already has git installed out of the box, judging by the label "Git" on the menu bar.
Here's a picture of my screen:
Menu: Tools->Command-Line:

Thanks for adding the picture. You need to have git installed. This can be done independently or through visual studio installer.
https://git-scm.com/downloads
It will ask you during installation if you want it to be added to the path - choose yes.
Once you have installed, launch the command window from start menu
and run git command. That should show something like this -
[2]
Once you have git command running from command line it should work from visual studio as well. Essentially VS is trying to launch that command from its shell and failing to find it because you dont have git installed.
VS does come with git installed but you have to choose it in its workloads. You have to go through all available installation options. See the screenshot below from VS 2017 installation workload. You can do this by re-launching your VS installer and selecting the products that you want installed. Since I use most of the things, I dont uncheck anything but that takes close to 50Gig space on the disk - something you want to be aware of.

Related

(Visual Studio Installation) Error 0x8007001d : Cannot write to the specified device

I can’t install Visual Studio Build tools.
when i want to launch the installation, a window appears telling me: writing impossible on the specified device.
I checked the logs and saw that there was an Error 0x8007001d
Also, I ran the installation with the command lines, I was able to download the files but then, when I run the command :
vs_buildtools.exe --noweb
It opens visual studio installer and I get the same Error 0x8007001d
You should know that without passing the command lines : vs_buildtools --layout d:\localVSlayout --lang fr-FR, I can’t download the packages in Visual Studio Installer
Have a good day

How do I fix visual studio installer (2019 community) is empty?

I downloaded the visual studio 2019 community installer and ran it. It ran successfully but instead of opening the visual studio installer when it completed it just closed. I located the visual studio installer 'setup.exe' (under C:/Program Files (x86)/Microsoft Visual Studio/Installer) and ran it. It opens the installer but instead of allowing me to select tools to install it just has 2 empty tabs labeled 'installed' and 'available' and a side bar that shows developer news.
I don't have any antivirus or firewall running. I uninstalled every version of visual studio I had in case the installer was assuming I already have VS2019. I updated windows and my drivers.
EDIT:
I had a hunch that I might find something out by using 'setup -h' in command prompt. It appears that it may be possible to install vs2019 by using the right tags.
I guessed
setup install --productid Microsoft.VisualStudio.Product.Community --channelid VisualStudio.15.Release
might work but the installer says "
A product matching the following parameters cannot be found:
channelId: VisualStudio.15.Release
productId: Microsoft.VisualStudio.Product.Community
"
If you know what the right tags are that might be an adequate solution.
Please try to reinstall it:
1) run cmd as Administrator and then type:
"%programfiles(x86)%\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe" -full
2) restart vs_installer again.

Using npm from the command line with Visual Studio 2015 Web Project

After installing Visual Studio 2015 I am able to use the new editor features to add dependencies to Node packages and restore etc from within a Web project as per this documentation: http://webtooling.visualstudio.com/package-managers/npm/
Presumably Visual Studio must install node/npm somewhere in order to support these features, however it does not seem to modify my PATH to make these tools available on the command line (or via Visual Studio 2015 Command Prompt).
If I want to perform some npm operations on my project from the command line can I do this without installing node/npm again (which might become out of sync with the version of npm/node that Visual Studio is using) or is there a way to access the node/npm installation Visual Studio is using from the command line?
VS2015 installs node using Joyent's installer. It depends on the system-wide install and it does not have it's own specific or local version.
If you're command line is unable to find node.exe, I would first check your path property in your environment variables and add it if it's missing (it should be C:\Program Files (x86)\nodejs). If you see node's install directory there but still can't access it from the command line, reboot. Sometimes Windows needs to restart before it uses the updated path variable.
Hope that helps.

Visual studio does not install .vsix files

I've both VS 2012 and VS 2013 installed on my computer. The problem is that when I download an VSIX-File and open it with the Visual Studio version selector the file gets opened by VS but instead of installing it. VS opens the file as if it was an unknown binary format.
The attached image shows how VSIX-files are opened (happens with every file ... this is just an example):
I faced the same issue. Just use the VSIXInstaller to install the extension.
You can open "Developer Command Prompt for VS2012" tool in Start -> Microsoft Visual Studio 2012 -> Visual Studio Tools. On the console, run the below command:
VSIXInstaller <path to vsix file>
Open "Developer Command Prompt for VS2015" as administrator.
Type VSIXInstaller.exe vsixFilePath
Note that this way wouldn't work with me and gives me "Path to vsix file 'G:\Roslyn' is invaild or you don't have required access permissions". To solve this you need to put the path in a double quote like this:
VSIXInstaller.exe "G:\Roslyn SDK.vsix"
I got into a weird situation where in a fresh install of W10 and VS2015 Community, the Player Framework vsix installation won't start, either by dbl click or from command prompt using VSIxInstaller.exe, and would show no message at all. The solution was to open an elevated command prompt (run Developer Command Prompt for VS2015 as administrator) and then type VSIXInstaller.exe worked.
I am not clear whether you want to install or just view the contents of VSIX. If you want to install the extension, you just need to double click it and it will install (Do not try to open it with VS Version selector). If you want to see what is inside VSIX, it is basically an archive. So either try to use program like 7-zip to open it else, rename .vsix to .zip and then unzip it.
Further, there is also a chance that you have wrongly associated vsix files to be opened with Visual Studio. In such a case it will open in Visual Studio any case.
Finally, if you have wrongly associated the vsix to open with Visual Studio, try installing the extension using VSIXInstaller.exe found in C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\VSIXInstaller.exe
To add to the other answers, if the VSIX files either doesn't have an associated program to open with or opens with the wrong application, selecting the VSIXInstaller.exe as the associated commands re-enables the ability to double-click and directly install it (without the need to do it via commandline).
I faced a similar issue when I first installed VS 2017. This is what worked for me.
Resolution:
Restart VS 2017.(I hadn't restarted it before installation)
Install it from Tools->Extension & Updates.Search for "Perforce" and install.
I double clicked on this and it installed just fine.
Couldn't do it on VS2013 through the extensions dialog.
for me the problem was the extension InstallerProjects was on network server so I had to copy it to my machine (local) and it worked

TFS command line 'Get' failing

I usually use the VS GUI for TFS and have never had any problem.
I am trying to get the command line working and am running TF from the root of the collection's mapped directory.
When I run TF Get <project name> /noprompt / recursive
I get the error message:
Unable to determine the workspace. You may be able to correct this by running 'tf workspaces /collection:TeamProjectCollectionUrl'.
I have run this but the error still exists.
When I run TF workspaces I have an entry for the computer I am on (the TFS source is on a different PC) and the collection path http://<comp name:port>/TFS/<project> which is correct.
Has anyone else been in this situation? The various pages I have found talking about it seem to stop after running the tf workspaces command. Has this always worked for everyone else? Perhaps I am just using it wrong?
You are getting this message because the TF get is being run outside of your workspace directory CD to the directory that contains the workspace that you need to work with first.
The commandline isn't asking for the TFS server uri, but for the ProjectCollection uri, so you need to add some extra information:
{https}://{tfsserver}:{port}/tfs/{collection}
Replace:
{https} make sure you use the right protocol, http or https.
{tfsserver} with the hostname of your tfs server
{port} with the port number (default: 8080 or 443)
{collection} with the project collection name (installation default: DefaultCollection)
The ProjectCollection isn't the same thing as the project, so make sure you're entering the correct values. Easiest place to find the collection name is to open Visual Studio and then the Source Control Explorer. The Uri for the project collection should be the root node. It might be that you're entering the Project name, instead of the ProjectCollection name.
If you're in a folder mapped to TFS, then tf get should figure the CollectionUri by itself.
When you have Visual Studio 2010 and 2012 or 2013 installed side-by-side, make sure you're using the Developer Command Prompt from the correct version of Visual Studio. With the advent of Local Workspaces, the 2010 commandline may not be able to find your mappings, where the 2012 or 2013 commandline will.
I fixed this problem by running tf using the "Visual Studio Command Prompt" (also known as the Developer Command Prompt) instead of running the default command prompt that comes with the operating system.
You can find it in Windows 7 under "Start -> All Programs -> Microsoft Visual Studio -> Visual Studio Tools -> Visual Studio Command Prompt".
You may find more documentation, including instructions for other versions of Windows, by visiting Microsoft's Visual Studio Command Prompt MSDN page.
I got this fixed with:
tf workspaces /collection:http://example:8080
tf workfold
tf get /r .

Resources