Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Monday, 17 August 2020

Add Azure Devops plugins in Android Studio for Git or TFVC Version control

 By default, Android studio can not connect to the Azure devops source codes. To connect to the Azure devops, a plugins by Microsoft needs to be installed in the android studio. To install the plugin, follow the below steps:


1) Open a project in Android studio
2) go to File --> Setting
3) go to Plugins
4) Search for azure devops
5) Click Install
6) Restart the Android studio.
7) Menu->VCS->Checkout from Version Control -> Azure Devops Git
8)Click Sign in ... 
9) Follow the wizard to connect the project.

Wednesday, 5 August 2020

Read TFS Project name from TFS Project collection using c#


Using Team foundation api.
 References:
Capture.PNG
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.dll
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Common.dll
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.WorkItemTracking.Client.dll


Code:
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Server;
using System;
using System.Linq;

class Program
{ private static ICommonStructureService _commonStructureService;
static void Main(string[] args)
{
ReadProject("https://tfssite.com/tfs/UK_ProjectCollection");
ReadProject("https://tfssite.com/tfs/IN_ProjectCollection");
Console.ReadKey();
}
 public static void ReadProject(String URL)
{
writeFile("Project Collection: " + URL);
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri(URL));
var collection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tpc.Uri);
_commonStructureService = collection.GetService<ICommonStructureService>(); var projects = _commonStructureService.ListAllProjects().OrderBy(a => a.Name);
foreach (var project in projects)
{

writeFile(project.Name);
}
 writeFile("------------------------------------------------------------------------------");
} public static void writeFile(String message) {
using (System.IO.StreamWriter file =
new System.IO.StreamWriter(@"C:\temp\tfs.txt"true))
{
file.WriteLine(message);
}
}
}

Output is the list of project names in tfs.txt file. 

GIT - SSL certificate problem: unable to get local issuer certificate

Error encountered while cloning the remote repository: Git failed with a fatal error.
unable to access 'https://tfssite.company.com/tfs/uk_projectcollection/SalesPortal/_git/SalesPortalWeb/': SSL certificate problem: unable to get local issuer certificate

Cloning into 'C:\Users\sojha\Source\Repos\SalesPortalWeb'...
Error encountered while cloning the remote repository: Git failed with a fatal error.
unable to access 'https://tfssite.company.com/tfs/uk_projectcollection/SalesPortal/_git/SalesPortalWeb/': SSL certificate problem: unable to get local issuer certificate




Solution: Open Visual Studio Command prompt

GIT provides an option to choose from OpenSSL and Secure Channel. Choosing secure channel in git global solves this issue.

Run the script:

git config --global http.sslBackend schannel

Friday, 26 June 2020

How to remove Workspace in TFS 2010-2018

TFS Workspace Guide Banner
How to Remove Workspace in TFS 2010-2018

A definitive guide to cleaning up old Team Foundation Server mappings

Have you ever encountered a "Workspace already exists" error or needed to clean up a developer channel mapping on a new machine? Dealing with stale Team Foundation Server (TFS) workspaces can be a headache.

This solution works for TFS 2010, 2012, 2013, 2015, 2017, and 2018.

The Solution: Visual Studio Command Prompt

The most reliable way to delete a stubborn workspace is through the command line tool provided with Visual Studio.

Step 1: Open the Command Prompt

Search your Start Menu for "Developer Command Prompt for VS 20XX" (where XX is your version) and run it as Administrator.

Step 2: Run the Delete Command

Use the following command syntax to delete the specific workspace:

tf workspace /delete /server:http://tfs.site.com:8080/tfs WORKSPACENAME
⚠️ Warning: This action is irreversible. Make sure you have checked in all your pending changes before deleting the workspace!

Example Scenario

If your user is sanjeebPC and your TFS server is located at http://tfs.site.com:8080/tfs, the command would look like this:

tf workspace /delete /server:http://tfs.site.com:8080/tfs sanjeebPC

After hitting enter, you may be prompted to confirm. Type Y and press Enter.

Conclusion

Using the tf command line utility is a powerful skill for any .NET developer using legacy TFS. It grants you control that the GUI often hides.

The Full Stack Guide: Connecting Angular with a .NET Backend

The Full Stack Guide: Connecting Angular with .NET ...