Profiling ASP.NET website in Visual Studio with Performance Wizard

Those who use Visual Studio 2010 may know that it now ships with a performance analysis tool that instruments your application in various ways.

You can run from Analyze > Launch Performance Wizard

Launch_perf

 

 

 

 

If you are profiling an ASP.NET website project then you must open it from File > Open Website > Local IIS

local_iis

 

Though there is one problem, if you do not have the right options enabled in Windows you might get an exception that reads

Error
VSP 7008: ASP.net exception: "The website metabase contains unexpected information or you do not have permission to access the metabase.  You must be a member of the Administrators group on the local computer to access the IIS metabase. Therefore, you cannot create or open a local IIS Web site.  If you have Read, Write, and Modify Permissions for the folder where the files are located, you can create a file system web site that points to the folder in order to proceed."

On this Visual Studio Profiler team blog post I found the right options that I needed to enable.

To check this in Windows 7:

  1. Open ‘Control Panel\Programs\Programs and Features’ (or run ‘appwiz.cpl’).
  2. Choose ‘Turn Windows features on or off’.
  3. In the ‘Internet Information Services’ section, make sure that the following options are selected.

After selecting the options re-launch the profiler, Visual Studio builds the solution, launches a browser window, browse some of the pages of your website while Visual studio records in the background, close the browser or hit Stop in visual studio to get the report.

Hope it helps you, let me know.

Microsoft Web Camp: My demo of MS Web Stack of Love

Last week I co-presented a session titled “Creating Cutting Edge Websites for Phones, Slates and Beyond” at Microsoft Web Camp in Dubai with Ronald Widha.

  • Opening Address, Michael Mansour
  • Development on Internet Explorer 9, Shaymaa Al-Terkait
  • Building an eCommerce Site in 13 Minutes with Web Matrix, Asli Bilgin
  • Creating Cutting Edge Websites for Phones, Slates and Beyond with WebMatrix and VS2010, Ronald Widha and Zubair Ahmed
  • Q&A with Pizza Dinner and drawing for a free Windows Phone 7!

From Microsoft Web Camp in Dubai

Ronald Widha talked about the challenge facing today’s designer and developers to build User interfaces that fit on desktop and phones alike, he discussed the Responsive UI design pattern and showed how Html5, CSS Media Queries and Fluid Images can help solve this issue to some extent. Get Ronald’s slides

I then showed some goodness from Microsoft Web Stack of Love and took Ron’s user interface markup to the new CSHTML page type in Web Matrix and changed it to get the content from a SQL Compact Edition database using the Razor view syntax, launched the same solution in Visual Studio from Web Matrix then added Entity Framework and WCF Data Services to the mix.

You can download all the tools using Web PI and get my code.

Here’s the video (I come at 23:20)

Creating Cutting Edge Website for Phone, Slate and Beyond from Ronald Widha on Vimeo.

Speaker(s): Ronald Widha, Zubair Ahmed

April 16, 2011

Microsoft, Dubai

The process of creating a website now always start with a question on figuring out the devices you want to support for; PCs, mobile phones and/or slate devices. Each of these devices may have different screen sizes, capabilities etc. For simplicity, designer/developer often chooses to build dedicated websites for each one of the platform which often leads to maintenance nightmare.

This talk showed how to design and develop a dynamic website for the various platforms using Responsive Design techniques. We’re starting up the process with WebMatrix and transitioning to Visual Studio 2010 as we progress. We touched on Html5, CSS3, Razor, Entity Framework 4 and C#.

Fun with VS2010 Ultimate: Comparing SQL Data

Update: Its an honor to have ScottGu and Scott Hanselman retweet this post and link from the “Gu” blog and also big thanks to Alvin Ashcraft & Chris Alcock for links to this post and offcourse thanks everyone else for RT-ing it on twitter. If you like this post then please visit back & dont forget to follow me on twitter @zubairdotnet

While playing with Visual Studio 2010 I discovered that the Ultimate (and Premium) edition ship with SQL Data and Schema Compare tools out of the box, so I decided to give a whirl.

I made two databases, SourceDB & TargetDB with only one table Customer. Here’s how the data looked like.

Source Target
sourcetable targettable


The Wizard

Next I selected the Compare Data options on the source table from Server Explorer

selectcomparedata

This brought up the interface where I chose the target database and hit Next, I decided to leave the other options checked.

datacomparewindow

Next screen showed the tables and views that I wanted to compare, in my case the only table Customer.

comparehitfinish


The Result

Now the interesting part,

datacompareresults

The changed records are off course highlighted.

In addition to the above ones that need to be updated, notice that there is only 1 record in the source table that the target needs to add and 1 identical that will remain unchanged,let’s look at them.

onlyinsource

onlyintarget



The Update

but this doesn’t end here, off course I could update my target database right from VS, for that I had two options, I could generate the script or have VS2010 do it for me.

Since I was playing, I thought let’s see both so I right-clicked and selected,

showscript

That brought up the generated Sql script in the editor that I could then use to update my target database,that looked like.

targetscript

Let’s look a bit deeper,hmm VS disables FK constraints,performs the operation and then restores it back, pretty good.

Since I was a bit lazy so thought I will have VS do it for me, all I had to do was…right-click and select..

writeupdates

VS 2010 then presented a confirm dialog, I knew what I was doing so I hit OK and the changes were pushed to the target table.

“Application Lifecycle Management in VS2010” session of TechiesUAE

I attended this session of TechiesUAE presented by Rolf Eleveld. First he took us through the installation and configuration steps required to run Team Foundation Server 2010 and Visual Studio 2010 beta 2.

Rolf then showed some of the new features in TFS 2010 version control and its integration with VS2010 including the web interface of TFS.

Also during the session, one of the interesting tool that he showed us is the new Problem Steps Recorder (or PSR) that ships with Windows 7.

psr

This tool can help developers and IT Pros know the steps required to reproduce any problem to resolve it more quickly. For more info on it watch this video

During the session we also discussed the use of Entity Framework & Linq to Entities in the enterprise and also saw the demo of the interesting new Lab management capabilities introduced in VSTS 2010. This helps testers test the software in a virtual environment and raise any bugs, the developers can then launch the virtual machine from the IDE and find all the rich information along with the check point link included in the bug, for more info on this read this post on Soma’s blog.

The session lasted more than 3 hours.

Update. Dec 3,2009
Read Rolf’s detailed notes from the event on the TechiesLeaders blog

VS 2010 Beta 1 and Functional UI Testing

I just watched a video over at Channel9 which explains how to leverage some of the UI Testing capabilities that are going to be introduced with VS 2010 beta 1 expected next week.

Visual Studio had testing capabilities for C# code for a long but now I’m glad to see for the first time an integrated UI testing built right into VS 2010 IDE. In particular I like the option to store the tests in the database and be able to run them automatically.

See it for yourself, there is also a Mix09 video here