Posts Tagged ‘Visual Studio’

Azure Cloud Load Testing – Part 2

In the previous blog post, I showed how easy it is to initiate a load test from Azure by just providing a URL of the web page you want to load test, specify the number of users and the duration. This is great for websites where requests are GET requests or you are not trying to test a user scenario that consists of multiple steps. In this post, I will show how to use Azure Cloud Load Testing in a more advanced scenario that consists of multiple steps.


In order to record a performance test which will be used for load testing, you need to have Visual Studio Enterprise or Ultimate Edition. You can download a 30 day trial version

Recording a Scenario

  • Open Visual Studio
  • Create a new Web Performance and Load Test project

  • Click the record button on your web test

  • Go through the scenario you want to record. I uploaded the scenario I recorded at
  • I recorded a test to go from the home page to the search page and then perform a search

You can test your script by clicking the run test button

Create a Load Test

A load test can consist of one or more test scenario. You can also define the duration of your test and the number of users to simulate running the test. Let’s create and configure a load test which will run in Azure.

  • Right click on your project
  • Add a load test by right clicking on the project and add a new itm

  • On the wizard, I am selecting a Cloud-based Load Test and click next

  • Select the location where the load will be generated from and click next

  • On the Run Settings page, you select the duration of the run and then click next

  • On the scenario page, name the scenario and select the Think time profile, think time is the duration between your test steps

  • On the Load pattern page, you can select a constant load of users or if you want to start with a smaller number of users and ramp up the user users while your test is running. I am using a constant load but you may want to use the second option if that what you want to simulate.

  • On the test mix page, you can select one or more tests. in my case I am only selecting one web test. You can also selected MSTest unit tests as well.

  • Add the browsers you want your users to use during the test

  • Click the Run load test button

  • Click on the Performance or Throughput buttons to see the graphs. The application button with capture the Application Insights telemetry


In this post, I showed how to create a performance and load test using Visual Studio 2015 Enterprise Edition and leverage Azure Cloud Load Testing to execute the recorded test. I didn’t have to create any Virtual Machines or install test agents to run my load test. I had to push a button and monitor the test run. Cloud load testing would save you a lot of money in infrastructure purchases and labour costs when you want to run load tests to similar millions of users and you want to only run the test scenarios for few weeks a year. The first 20,000 Virtual User Minutes (VUMs) a month are free. Give it a try today.

Azure: Provisioning a Visual Studio 2013 Ultimate VM in minutes!!

As you may already know, some MSDN Subscriptions come with Windows Azure Credit that can be used for Dev and Test usage. As of October 24, 2013, you can get upto $150 to spend on your Windows Azure account. For more detail visit


In this post we will provision a new VM on Windows Azure with Visual Studio 2013 Ultimate. All steps and screen shots were done and taken on October 24, 2013.

Activate Your MSDN Windows Azure

Login to MSDN

Click on MSDN Subscriptions


Click on the Access benefits button



Click the Activate Windows Azure link


Windows Azure Portal

The previous steps should activate your Windows Azure account and take you the Windows Azure Portal. If you have already activated it before, you can go directly to and sign in with your account


Select your subscription


Click on the Portal button


Click Virtual Machines link on the left and then click new on the bottom


From the Menu, click on the From Gallery menu item


I am selecting Visual Studio 2013 Ultimate on WS 2012 but feel free to select another VM image and click on the arrow at bottom right corner


Give the VM a name

Select the VM Size

Create a username and password (we will use that username to login using remote desktop)

Click next


Select a Cloud Service if you have one or choose Create a new cloud service

Give it a name

Select a location

Click next



I am leaving all fields as default value

Click the check mark at the bottom right


The VM now is being created, it took around 5 minutes to complete the provisioning of the VM


When provisioning is completed, you will get notified at the bottom of the screen

Click on the connect button

Double click the downloaded rdp file or open it from your browser


Enter your username and password and you

SQL Server Data Tools – September 2013 update

Microsoft has released the September 2013 update for SQL Server Data Tools (SSDT). It contains a fix for the schema compare when working with large display text or high DPI.

Visual Studio 2013 Release Date

Microsoft has announced that Release Date for Visual Studio 2013 is November 13, 2013. October 18, 2013

Along with the RC release today, we announced the VS 2013 RTM (Oct 18th) and launch dates (Nov 13th).

The launch date is still Nov 13, 2013. You can join the Virtual Launch event at

In the meanwhile, you can still download RC version of Visual Studio/TFS 2013



Visual Studio 2012 Update 4 RC3

Visual Studio 2012 Update 4 RC3 is out. You can downloaded from

Check out this link for the update description

Install instructions

  • Visual Studio
    • VS2012.4 RC.exe
  • Team Foundation Server (Choose either Web Installer or ISO Image)
    • Web Installer: tfs_server.exe
    • ISO Image: VS2012.4 RC TFS Server ENU.iso
  • Team Foundation Server Express (Choose either Web Installer or ISO Image)
    • Web Installer: tfs_express.exe
    • ISO Image: VS2012.4 RC TFS Express enu.iso
  • Visual C++ Redistributable (Choose architecture: x86, x64, arm)
    • vcredist_x86.exe
    • vcredist_x64.exe
    • vcredist_arm.exe

TFS2012: Schedule a One Time Team Build–Approach 1

In response to the questions asked on MSDN social, I am writing this blog post. The question was “How to schedule a one off build”. I also posted an alternative approach here


When creating a scheduled build, you need to specify the the day of week and time.


But what if you only want to schedule it to run once? That scenario is not supported by TFS out of the box.


One of the solutions I am proposing in this post is to create a scheduled build definition and a custom activity to reset the build definition trigger to manual when the build is complete. The limitation for this approach is you can’t specify a date (e.g. 22/1/2013). In other words, you can only schedule it for the next 7 days.

I am using TFS2012 and Visual Studio 2012 for this solution. You can still use the same steps for TFS 2010.

Creating Build Activity

Create new project of type Activity Library and name it TeamBuildActivities


Delete Activity1.xaml


Add new item of type Code Activity and name it SetTeamBuildDefinitionTriggerToManual



Add a reference to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Build.Client.dll

Paste the following code in the SetTeamBuildDefinitionTriggerToManual .cs file

using System.Activities;
using System.ComponentModel;
using Microsoft.TeamFoundation.Build.Client;

namespace TeamBuildActivities
public sealed class SetTeamBuildDefinitionTriggerToManual : CodeActivity

public InArgument<IBuildDetail> BuildDetail { get; set; }

// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override void Execute(CodeActivityContext context)
if (BuildDetail == null)
IBuildDetail buildDetail = context.GetValue(BuildDetail);

if (buildDetail == null)

buildDetail.BuildDefinition.TriggerType = DefinitionTriggerType.None;


Save and build the project

Copy the output assembly TeamBuildActivities.dll to C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies

Create a build definition

Create your build definition with a scheduled trigger


On the process, click show detail and then the new button


You should rename the New file name, I am keeping the default name in this example

Click OK

Open the Source Control Window

Right click on the new build process template and get latest


Double click on the new build process template to open

Open the Toolbox window

Create a new Tab and call it Custom Activities

Right click on the custom activity area and select Choose Items


Make sure that System.Activities Components Tab is selected

Click on the browse button

Go to the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies folder and select the TeamBuildActivities.dll and click OK


Drag and drop the activity at the end of the workflow


Type in the BuildDetail argument into the BuildDetail property grid


Save workflow template and then check it in


Create new Folder in TFS Source Control for Build Activities

Go to the Source Control Windows

Create new folder, I am naming it TeamBuildAssemblies


Open the local folder and copy TeamBuildActivities.dll to it


Go back to source control

Right click on the folder you created and select Add Items to folder


Select TeamBuildActivities.dll from the window


Check in the folder


Point Controller to the TeamBuildAssemblies

At this point, we want the team build to load the custom activity we created to initiate an  instance of the SetTeamBuildDefinitionTriggerToManual activity

Click on Actions

Then Manage Build Controllers


Click on Properties

Select the path for the TeamBuildAssembles folder


Click OK

Queue a Build

Lets queue a build to simulate the running of a scheduled build

You may get the following error

TF215106: Access denied. NT AUTHORITY\NETWORK SERVICE needs Edit build definition permissions for build definition TeamBuildActivities in team project MyTeamProject to perform the action


To fix the error you need to give  “Edit build definition” permission to the build account

Right click on the team build definition

Select Security


Select Build Service Accounts

Change the value for Edit build definition to allow

SCROLL DOWN AND CLICK SAVE CHANGES. For low resolution screens this may not be so intuitive because the button is hidden


Now queue another build


Edit the build definition and click on the Trigger tab


Notice that it is switched to Manual

Visual Studio 2012: Tips and Tricks

Expertise Level


I will explain some of features I usually use while developing and they increase my code productivity. Some of the explained tips in this post may be available in previous versions of Visual Studio.


Tab Pinning

This feature is available for C# and VB.NET. It allows you to pin the tabs to the left of the others tabs and in case you open many documents the pinned files will always be visible. To pin a document, click on on the pin icon as shown on the following figure



Ctrl + Shift + Tab

When you have many documents opened, one easy way to navigate through the opened documents is to click on the Ctrl + Shift + Tab and then click on the Tab key again to navigate through the opened document


To Navigate through the Active Tool Windows, all you need to do is clicking on the left arrow key.


Quick Launch

This is a new feature in Visual Studio 2012. It allows you to search all tools and options available in Visual Studio. The Quick Launch box is available at the topic right corner of Visual Studio 2012 next to the minimize button.


Lets say I want to show the line numbers in the editor. Instead of trying to find that option in the Options dialog, I can just type “line number” in the Quick Launch textbox and that should take me there.



File Preview

One of new features in Visual Studio 2012 is the ability to open files with out cluttering the tabs bar. The preview tab opens on the right side of the tabs bar.


To preview a file, you need to single click on the document. One of the limitations I found is that documents don’t open in design mode in the preview tab.

To activate the File Preview feature, you can either click on the Preview Selected Items on solution explorer


or type Preview in the Quick Launch textbox


Then check Allow new files to open in the preview tab and Solution Explorer



Navigate Backward and Forward

This feature is one of the most features I use on daily basis. The navigate backward allows you to move back and view the line of code you were working on before the current line. For example, if you were working on method X and then you moved to method Y, the navigate backward brings method X back on focus. The navigate forward moves the focus back to method Y.

To navigate backward, you press the Ctrl + – keys

To navigate forward, you press the Ctrl + Shift + – keys


Organize Using

This is an easy one, when you right click on the text editor, you get the Organize Using context menu item which has three options in its sub menu

Remove Unused Usings: deletes the using statements that are not needed (used).

Sort Usings: sorts the using statements alphabetically.

Remove and Sort: combines the above to commands.



Code Generation

One of the great productivity features in Visual Studio is code generation. For example, when you implement an interface or you type a class type that is either not implemented or you didn’t add the using statement for the the class’ namespace, you will see a blue underscore below the first letter


At that point, you can either click on the blue underscore or press Ctrl + . to see your options




Navigate To Dialog

The dialog can be launched by pressing on Ctrl + , . Its functionality is similar to the Search Solution Explorer in Visual Studio 2012.


Alt + Select

Alt + Select Allows you to select text vertically. For example, I have three methods that are marked as public and I want to change their visibility to private


I select the methods’ modifier, place the mouse cursor before the first public key word and then press the alt + select keyboard keys and drag with the mouse to cover the letter c of the third public keyword. After you had all the public keywords highlighted, you can type the keyword private


You will notice that the three modifiers are being changed at the same time.

Go To Line

If you know the line number in you code where you want to navigate to, press Ctrl + G to go to that line