Archive

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.

Prerequisites

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 https://youtu.be/6-ZiIL7yPpA
  • 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

Conclusion

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

http://www.windowsazure.com/en-us/pricing/member-offers/msdn-benefits-details/

How?

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

image

Click on the Access benefits button

image

 

Click the Activate Windows Azure link

image

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 www.WindowsAzure.com and sign in with your account

image

Select your subscription

image

Click on the Portal button

image

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

image

From the Menu, click on the From Gallery menu item

image

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

image

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

image

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

Give it a name

Select a location

Click next

image

 

I am leaving all fields as default value

Click the check mark at the bottom right

image

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

image

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

image

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.

http://blogs.msdn.com/b/ssdt/archive/2013/09/18/updated-sql-server-data-tools-for-september-2013.aspx

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).

http://blogs.msdn.com/b/bharry/archive/2013/09/09/visual-studio-2013-amp-tfs-2013-rc-is-available.aspx

The launch date is still Nov 13, 2013. You can join the Virtual Launch event at http://events.visualstudio.com

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

http://www.microsoft.com/visualstudio/eng/2013-downloads

 

 

Visual Studio 2012 Update 4 RC3


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

http://www.microsoft.com/en-us/download/details.aspx?id=40263

Check out this link for the update description

http://support.microsoft.com/kb/2872520/en-us

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

Introduction

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

image

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

Solution

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

image

Delete Activity1.xaml

image

Add new item of type Code Activity and name it SetTeamBuildDefinitionTriggerToManual

image

image

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
{
[BuildActivity(HostEnvironmentOption.All)]
public sealed class SetTeamBuildDefinitionTriggerToManual : CodeActivity
{

[Browsable(true)]
[DefaultValue(null)]
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)
{
return;
}
IBuildDetail buildDetail = context.GetValue(BuildDetail);

if (buildDetail == null)
{
return;
}

buildDetail.BuildDefinition.TriggerType = DefinitionTriggerType.None;
buildDetail.BuildDefinition.Save();

}
}
}

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

image

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

image

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

image

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

image

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

image

Drag and drop the activity at the end of the workflow

image

Type in the BuildDetail argument into the BuildDetail property grid

image

Save workflow template and then check it in

image

Create new Folder in TFS Source Control for Build Activities

Go to the Source Control Windows

Create new folder, I am naming it TeamBuildAssemblies

image

Open the local folder and copy TeamBuildActivities.dll to it

image

Go back to source control

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

image

Select TeamBuildActivities.dll from the window

image

Check in the folder

image

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

image

Click on Properties

Select the path for the TeamBuildAssembles folder

image

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

image

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

image

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

image

Now queue another build

image

Edit the build definition and click on the Trigger tab

image

Notice that it is switched to Manual

Visual Studio 2012: Tips and Tricks


Expertise Level

Beginner

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

image

 

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

image

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.

image

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.

image

 

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.

image

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

image

or type Preview in the Quick Launch textbox

image

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

image

 

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.

image

 

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

image

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

image

image

 

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

image

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

image

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