FailedRequest: Service Unavailable(503) for TFS on Visual Studio Code - visual-studio-code

I'm trying to integrate VSCode with TFS using this Stackoverflow answer.
I have installed the Azure Repos extension and in my settings.json folder, I have done the following:
{
"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\TF.exe",
"tfvc.restrictWorkspace": true
}
While trying to do the team signin portion through the command palette however, I'm prompted with this message:
Provide the username for server (servername:8080)
I enter this and my password, but the connection fails. On the bottom of my VSCode window, I can see this error message when I hover my mouse over the "Team" text:
Failed Request: Service Unavailable(503) - http://servername:8080/tfs/companyprojectcollection/_apis/tfvc/branches
I'm a bit confused. On Visual Studio 2019, to add a server I just had to add the url as http://servername:8080/tfs and login with my credentials, after which I was able to view the workspace/folder that was created for me.
Do I need to edit the initial server it requests me to log into as "http://servername:8080/tfs" instead of "servername:8080", and if so, how?
Why does the error say service unavailable with added folders like companyprojectcollection/_apis/tfvc/branches? How do I fix this?
I could use Visual Stuio 2019, but VSCode is my preferred editor.
EDIT: The error while hovering over the Team button. This is the same format in which I saw the 503 error earlier, except that said "Service Unavailable(503)"

Failed Request: Service Unavailable(503) - http://servername:8080/tfs/companyprojectcollection/_apis/tfvc/branches
From the error message, it seems that the linked URL has some issue. Generally, the URL to connect to the tfvc repo is like this:
http://servername:8080/tfs/DefaultCollection/tfvcrepo
Here are the steps to link the TFVC repo in VS code:
Step1: Create a workspace and map the workspace to local machine in Visual Studio 2019.
Then the Tfvc Repo will be checked out in the path.
Step2: Open either the root folder or a sub-folder of the TFVC repository (workspace path in step1) in VS code.
Step3: Run the team signin command and input the Username and Password. Then the VS code could connect with the TFVC repo.
In this process, there is no process of customizing the URL, it will automatically recognize the tfvc repo related to the workspace.
Note: the settings.json file is still required for TFVC repo. Your settings are correct.
For mode detailed information, you could refer to this Guidance document.

Related

Github is not working in Visual Studio Code

I have tried to install the GitHub pull and request extensions in the Visual Studio Code.I installed it. But when I searched "Github" in the Visual Studio there is nothing showing in the visual studio code.
Your question is not clear, but I will try to answer it based on my understanding.
Try with Ctrl+Shift+P and search git, you should see all git commands.
From the official website:
To get started with the GitHub in VS Code, you'll need to install Git, create a GitHub account and install the GitHub Pull Requests and Issues extension.
Once you've installed the GitHub Pull Requests and Issues extension, you'll need to sign in.
After this, you can search for and clone a repository from GitHub using the Git: Clone command in the Command Palette (Ctrl+Shift+P) or by using the Clone Repository button in the Source Control view (available when you have no folder open).

Error: repository checked out but no solution found - when cloning Github repo using Visual Studio 2019 for Mac

Using Visual Studio for Mac (vs 8.10.14) I am trying to clone an existing Github repository.
In Visual Studio I navigate to Version Control/Clone Repository... I fill out the https path (copied from my Github repo) and hit the Clone button. Prompted for Username I enter my Github username and for password I use my freshly generated PAT (Personal Access Token) with credentials for "repo"=Full control of private repositories.
Then the clone process starts but immediately stops with error message: "Repository checked out but no solution found". After selecting the only option "OK", the process stops fully without cloning a single line of code.
Has anyone found a solution already?

Unable to connect GitLab with Visual Studio Code

I'm using a self-hosted GitLab instance deployed for the company, along with Visual Studio Code.
I downloaded the extension "GitLab Workflow" in Visual Studio Code, so I can see my GitLab projects hosted in the company instance.
During setup, I entered:
The company GitLab instance URL "https://XXXXXXXXXXXXXXXXXXXXXXXXXX"
The PAT (personal access token) related to my personal space that contains all my projects.
I also entered the below URL in the configuration file of Visual Studio Code: Settings → Extensions → Gitlab Workflow → Instance URL as described in this article, section: Setup / Step 2:
{
"window.zoomLevel": -1,
"workbench.colorTheme": "Visual Studio Dark",
"terminal.integrated.shell.windows": "C:\\windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"gitlab.instanceUrl": "https://XXXXXXXXXXXXXXXXXXXXXXXXXX"
}
But when trying to see my GitLab projects from VS Code, I get this error message:
Failed to parse GitLab API response
Command failed with exit code 128: git ls-remote --get-url
fatal: No remote configured to list refs from.
Error: Command failed with exit code 128: git ls-remote --get-url
fatal: No remote configured to list refs from.
at makeError (c:\Users\XXXXXXX\.vscode\extensions\gitlab.gitlab-workflow-3.9.0\node_modules\execa\lib\error.js:59:11)
at handlePromise (c:\Users\XXXXXXX\.vscode\extensions\gitlab.gitlab-workflow-3.9.0\node_modules\execa\index.js:114:26)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
It sounds like the extension doesn't know what remote to fetch from GitLab (a configuration issue rather than connection). Try adding this to your settings.json file:
"gitlab.remoteName": "origin",
If you use a different remote name, then replace "origin" with your remote. You can see the details of your remote using Git:
git remote
Visual Studio Code includes native capability to connect with GitLab.
At "Start", click on "clone repository" and then paste the target URL at the navigation bar:
I found this answer on their docs, if you already using Windows you should turn off your http.systemCertificates in VSC setting.json
thanks to this answer here

VS Code: Get 'Bad credentials' when using Clone Repository

I use vscode version 1.45.1. I get 'Bad credentials' when using Clone Repository. Lately I changed my username at github. That could be the reason. How do I tell vs code that?
You'll need to open up Credential Manager in Windows and delete (or edit) the Github account there:
You'll need to restart Visual Studio Code for it to prompt you to login to Github again.
Also note that you may need to revoke the OAuth connection in Github under https://github.com/settings/applications:

How do I commit to a remote repository on Visual Studio?

I figure this may be somewhat of a common question, but I am still having trouble with what I am finding. Note: I am very new to deploying applications. I have created my first application, an ASP.NET MVC application using Visual Studio Community 2015(I am using enitity framework for the database if that matters). It is time for me to deploy it. I have all my files on gitHub. Now I believe it is time for me to commit to my remote repository on AppHarbor (which I have the link for), but I just can't seem where to do it. It seems to be so simple. I'm using the team explorer. Again, I am very new to programming and deploying applications, so any help would be amazing. Again, from what I understand I need to connect to my remote repository now. I could be wrong. Thank you very much for any insight.
Inside Visual Studio, open the 'Team Explorer - Connect' Window. Default Shortcut for that should be Ctrl+/ + Ctrl+M.
Inside the Team Explorer window, Click on the green plug like button that you see that says "Manage Connections". You will be able to connect to your remote repo from here.
After that, Click on 'Clone' and paste your repo's URL in the yellow text box:
If your remote repo is on the GitHub, this is where you can find the URL to your remote repo:
Well, that's it.. you're connected! To commit your changes, you can easily find the "Changes" section in 'Team Explorer' window. Here's a screenshot for that too:
Note that in my case some of the buttons shown may be Disabled. That should not be a problem to you if you have files with changes, etc.
I don't know about Visual Studio, but with git you need to push your changes to a remote repo, so maybe you have a "push" somewhere ?
First you need to add this remote repository.