Upgrade TFS2015 Update 1 from TFS2012 Update1 error


I was upgrade TFS 2015 update 1 from TFS2012 update 1 and I had a small error as the following:
TF400311: The database connection strings are not valid and cannot be automatically corrected. To fix this problem, use the TFSConfig RemapDBs command-line tool to correct the database connection strings.
Completed VerifyShouldRunRemapDbs: Error

This only happened because I didn’t include the default collection DB as it was not needed by the customer.

TFS2015 Update1 Upgrade error

How to work with Git from command line (Windows)


It’s very important to know the commands behind the UI in Visual Studio, in this post I just explain the basic you need to work with Git from the command line.

The first step is to set the global settings, but first list display what it’s value.

git config –global -l
If there is no settings it will tell you no such a file, if there is data it will be displayed as the following:
git config --global -l

If you open the user folder, you can see that file .getconfig, also if you open the Visual Studio and navigate to global settings you will find that this info has been set too.
.gitconfig

I can also edit this file using VIM
git config --global -e

This will open Unix editor, to quite that window I need to type :q +enter
you can press i to start entering text and save by pressing esc and :wq and enter, this will commit with the message you typed. In your current state, to just come out without committing, you can do :q
git config --global -e edit

If you open the file without a proper exit, it will create a swap file and you can’t open it again smoothly, you just need to delete that swap file or close the file as mention before

.gitconfig.swp

Navigate to the directory you want to use and type:
git init
git clone https://github.com/youraccount/rep

This will copy all files to your local files, try to add new file and then add it using
git add .

Try to see the status using
git status

Commit the changes
git commit -m ” your message”

Change the branch
git checkout branchName

Push changes
git push https://github.com/youraccount/rep

Sync between my GitHub and Visual Studio Online


I needed to sync between my project on GitHub and Visual Studio Online, and to do so I used Git remote which enable to connect to a remote repo and then pull from it and push to the other repo.

First I need to enable Alternate authentication credentials for my account on VSO
Alternate authentication credentials VSO

I open my local repo with Visual Stuido 2015 which is connected to my VSO

I add remote repo by open the command line to that local repo and type:
git remote add github https://github.com/Codeflyers/EC-GitHub
git remote add github

Select the local branch by double click(not from remotes), make sure it’s bold
Select origin branch on Git

You can also use the command line instead of Visual Studio, just type git checkout the needed branch, if you look at the Visual Studio, you will notice it’s also bold
git checkout branch

Now, you can pull from the needed branch for example:
git pull github dev
git pull github
Push to the VSO
git push origin dev
git push origin
I will need to do that with each branch, I can remove the remote repo by type:
git remote remove github

I will keep the remote repo to sync later.

Also I can remote repo to VSO by type:
git remote add vsonline https://codeflyers.visualstudio.com/DefaultCollection/_git/EC-VSO/

How to Upload a Virtual Machine to the Cloud for Microsoft Azure


Recently, I worked with Microsoft Azure to provide better solutions using Visual Stuido 2015 and Team Foundation Server 2015 and Visual Studio Online, here…I will just share my experience about that through a new series which introduce different and random features for Microsoft Azure

  1. How to Upload a Virtual Machine to the Cloud for Microsoft Azure

—————————————————————————————————————–

How to Upload a Virtual Machine to the Cloud in Microsoft Azure

  1. Create a container inside the Storage

image001

  1. Create a storage. I named my storage vmsmra

image003

  1. Click on the storage <vmsmra> to see the containers inside

image005

  1. Select which container you want to use to upload your virtual hard disk. (In this walk-through I choose uploadedvhds
  1. Open the machine that you will use to upload. In this case we use Azure Powershell.

Note: If you don’t have yet Azure Powershell, you can download it from Github or just use the direct link which I prefer.

           http://go.microsoft.com/fwlink/?LinkID=279888&clcid=0x409

image007

  1. After installing, run Microsoft Azure PowerShell

Note: You can type help azure and this will display all the commands that will help you in doing your work

image009

  1. First thing you need to do is to connect to your Azure account. You can do this by typing Add-AzureAccount then press Enter

image011

  1. Login page for Microsoft Azure will pop-up. Enter your email address and click Continue.

image013

  1. Then it will ask you to sign into your Microsoft Account. Enter your email and password then click Sign in

image015

  1. After connecting your Azure subscription, it should look something like this:

image017

  1. Then you need to add the vhd by typing

Add-AzureVhd –Destination <destination path> -LocalFilePath <local file path>

Then press Enter

image019

  1. You will then see that it is starting to calculate MD5 Hash. This step may take a while to complete before you can see the result.

image021

 

  1. After creating MD5 hash, it will start detecting empty blocks and this usually last for 10 minutes

image023

  1. After successfully uploading the vhd, it will look something like this:

As you can see, it took me 1 hour and 27 minutes to upload my vhd (80 GB)

image025

  1. Now go to Storage > vmsmra

image027

Under vmsmra, click  uploadedvhds to view your uploaded vhd

image029

Clicking uploadedvhds will show you the vhds you uploaded. It will also show the size of your VHD

image031

  1. Now we are ready to create our disk. First you need to click Virtual Machines, then click Disks

image033

  1. After clicking Disks, it will display all the names of the disk and its details. To create a new disk, you need to click +Create found below

image035

A pop-up window will be displayed

image037

  1. Fill up the box by typing the Name, VHD URL (location of your uploaded vhd) and the operating system family. Then click Open

image039

After that, you will see that it is starting to create the disk

image041

After few minutes, it will now show that the disk has been successfully created

image043

  1. We are now ready to create our virtual machine. To do this, under Virtual Machines, click Instances then click New found at the bottom.

image045

It will show a window where you can create your virtual machine.

image047

After that, this window will open. Name your virtual machine, leave the Tier to Standard then select the memory size of your virtual machine.

image049

After that, details of your virtual machine configuration will be displayed

image051

  1. It will now show that you successfully created a virtual machine and need to wait as it is starting provisioning

image053

You will know that it is completed once the status changed to “Running”

image055

  1. To connect to the machine, go to Virtual Machines, then select your virtual machine and click Connect found at the bottom

image057

It will then show that it is downloading  the .rdp file. Click OK

  1. Open your .rdp file on your local machine, then click Connect

image061

  1. Enter your credentials, the establish the remote desktop connection

image063

And you can now access the machine of Brian Keller that you uploaded in Windows Azure

image065

Microsoft Visual Studio Team Foundation Server 2015 Process Editor errors


As we know that Visual Stuido 2015 and Team Foundation Server 2015 has been released, when I started working with the new TFS Power Tool, I found that there are some errors comes with the Process Editor tool.

If we try to customize some types of the work-items, we might see the following error:
Control ” references a non-existing field System.ID.
non-existing field System.ID

We just need to change the name of the control to the right one with the small letters as the following:
Wrok-Item System.id

Another error:
VS402479: You can’t overwrite the Scrum process template, because it’s locked. For more information about customizing process templates, click ‘Help’.
VS402479 You can't overwrite the Scrum process template, because it's locked. For more information about customizing process templates, click Help.

We just need to generate GUID and add it to the ProcessTempalte.xml file as the following:
GUID for TFS Process Template

Another error that Reason field is read only for the Product Backlog Item, so no matter what you added extra reasons, it wouldn’t appear, to fix that we just need to change that to false, see the following image:
ProductBacklogItem layout

Unable to create workspace due to a mapping conflict


It’s a small issue, you may encounter if you name your build definition with the same name as an old one.

Here is the error
Exception Message: Unable to create the workspace ’80_6_tfs2bld’ due to a mapping conflict. You may need to manually delete an old workspace. You can get a list of workspaces on a computer with the command ‘tf workspaces /computer:%COMPUTERNAME%’.  Details: The path C:\Builds\6\Windows\src is already mapped in workspace 77_6_tfs2bld. (type MappingConflictException) Exception Stack Trace: at Microsoft.TeamFoundation.Build.Workflow.Activities.TfCreateWorkspace.Execute(CodeActivityContext at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager,

Unable to create the workspace due to a mapping conflict

You will need to go to the build machine, search for the old workspace that use the same build definition name, delete that one so the build can create new worksapce with the same name again.
Delete workspaace