Tour of Windows 8 Consumer preview, Visual Studio 11 beta at Microsoft Gulf, 31st March 2012

I am invited by Microsoft to give a tour of the new features in Windows 8 Consumer Preview. I will also walk through the new Visual Studio 11 beta and show how to create a Virtual Hardisk (VHD) and install Windows 8 using Powershell.

Join me on Mar 31st 2012 at Microsoft Gulf, Building 8, Dubai Internet City.

A free registration is required to attend this event, signup now.

Windows8 Techout

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

PLINQO or LINQ to SQL “Supercharged”: Getting Started

plinqologo

The goal of this post is to introduce you to PLINQO or Professional LINQ to Objects for CodeSmith Studio Professional to generate LINQ Entities and Query extensions.

By the end of this post you should know how to get a working Visual Studio project containing a single DBML file, Entity classes for your database tables & helpful Query Extensions generated using CodeSmith Studio and PLINQO.

PLINQO is developed by CodeSmith Tools, to follow the steps you need to have CS Studio installed, download the free trial

Let’s get started..

When we fire up CodeSmith Studio we get the Template Explorer window,expand Framework and see PLINQO installed out of the box.

codesmithtools

I have expanded the CSharp folder and notice that it contains a bunch of .cst template files,PLINQO uses them to generate our objects.

Right-click on QuickStart.cst and clicking Execute brings up this dialog with bunch of properties.

qsdialog

We look at them in just a moment, first click the … button on SourceDatabase property, for the demo I am using a Northwind database, so let’s select it.

adddbconnection

We can see that rest of the properties fill automagically,now lets take a look at each of them.

nwfilled

After the source database info, PLINQO needs to know the target language to generate the entities,location where the files will be generated and so on.

Now lets talk about the not so obvious ones.

  • By default PLINQO generates 3 projects, a DAL project, a Dynamic Data website or web application project and a Test project.

The Data Project group tells the namespace for the data project,do we need to copy the template files to the target folder and type of queries it should generate,this has 2 options QueryExtensions and ManagerClasses, we will look them in a future post.

The Interface Project needs to know whether or not generate a Data web service file, type of project (Web application or Website) and the project name.

The Test project properties tell whether or not include a Test project in the solution and the name of the test project.

Let’s leave the default selected,specify the target Location and hit Generate,

This launches Visual Studio with a solution that contains our 3 projects.

gensolexp

To generate Entities and Queries we need to do one last step before we’re on our way.

Before we do that let’s go behind the scenes to see how PLINQO will generate the classes for us,so

Right click on Northwind.Data.csp file and select Manage Outputs.

manageop

This will bring up the following dialog, PLINQO uses the information in these outputs to generate the templates.

manageopdialog

For instance double-click on DBML will bring up a dialog where one of the things I can do is change the Ignore Pattern to exclude tables with a matching name that I don’t want or change the name of the base class for all my entities.

In Entities I can change the default location of the Entities output directory for instance, similarly in Queries I can change the default name of the Datacontext object that PLINQO generates.

Let’s leave them unchanged, Cancel the dialog and go back to the Solution Explorer.

Right-click the Northwind.Data.csp file again and this time select Generate Outputs.

genop

PLINQO will then build the solution,generate Entities and Queries required to query the database.

The final output looks like.

output

Let’s open the generated Northwind.dbml.

dbml

Perfect, now let’s go to Northwind.UI project and fire up Default.aspx in the browser.

dyndatasite

Nice so we got a fully working ASP.NET Dynamic Data web application project generated using PLINQO from a Northwind database.

In a future post we’ll see how PLINQO simplifies querying data with the help of some useful extension methods and few other tricks.