Getting Started With Windows Azure Development

In order to start working with Windows Azure Development following components are required

Windows® Azure™ Software Development Kit

Windows Azure Tools for Microsoft Visual Studio

Login to Windows Azure services

Windows Azure Consists of following four main components

  • Windows Azure: Provides a Windows-based environment for running applications and storing data on servers in Microsoft data centers.
  • Microsoft
    .NET Services: Offers distributed infrastructure services to cloud-based and local applications.
  • Microsoft
    SQL Services: Provides data services in the cloud based on SQL Server.
  • Live Services: Through the Live Framework, provides access to data from Microsoft’s Live applications and others. The Live Framework also allows synchronizing this data across desktops and devices, finding and downloading applications, and more.

    In order to develop a hello word web cloud service I installed the SDK and found the following Visual Studio templates installed in my VS 2008.

    In order to run the Service Bus Echo sample I compiled the sample placed at C:\Program Files\Microsoft .NET Services (Nov 2008 CTP) SDK\Samples\ServiceBus\GettingStarted\Echo\CS35

    Which is a simple Echo application. On running the application I was able to connect to my Windows Azure online Service bus end point by providing the solution name and the password for the solution set in the service Credentials interface. Similarly I was able to connect to the Service using the client application and the resulting echo sent from the client application was Echoed on the Server application. So in short the client and server where able to talk to each other through an intermediate service bus provided by windows Azure services. If this client and server live in separate data centres behind firewall or whatever, as long as they can access the internet they will be able to communicate to each other.

    This all looks very interesting and I am inclined to look into it in more detail and utilize my windows Azure account to develop applications against it.References :

    the excellent White Paper by David Chappell

    Blog post by Mike Ormond

    MSDN Azure Services platform

First Look at LINQ

I have been wanting to look into LINQ for quite sometime and finally last week, due to the requirements of our current project I had to quickly get into it and use it.
My first impression is that although a bit tricky to get your head around terms like Expression Tree’s , Lambda Expressions, and Extension Methods etc, once your understand the tricky notations it really is fascinating what you can do with it.

Last week I attended a London.net user group meeting on DSL and realized how much Domain Driven Development is being utilized in LINQ , and that is surly one of the upcoming development methodologies , so one thing is for sure that I need to spend much more time understanding LINQ and the related technologies.

A simple LINQ to Object example looks something like this

string[] presidents = {

“Adams”, “Arthur”, “Buchanan”, “Bush”, “Carter”, “Cleveland”,

“Clinton”, “Coolidge”, “Eisenhower”, “Fillmore”, “Ford”, “Garfield”,

“Grant”, “Harding”, “Harrison”, “Hayes”, “Hoover”, “Jackson”,

“Jefferson”, “Johnson”, “Kennedy”, “Lincoln”, “Madison”, “McKinley”,

“Monroe”, “Nixon”, “Pierce”, “Polk”, “Reagan”, “Roosevelt”, “Taft”,

“Taylor”, “Truman”, “Tyler”, “Van Buren”, “Washington”, “Wilson”};

IEnumerable<string> items = presidents.Where(p => p.StartsWith(”A”));

foreach (string item in items)

Console.WriteLine(item);

The LINQ Project is hosted here

Highlights of FOWA 2008 day 2

Thanks to my colleague Christoph Schmaltz I was able to go to FOWA on day 2. It was an interesting experience, I have not been to such a big technology conference before, and it was a good learning experience , I attended most of the presentations in the developer tack, however the most interesting talk was from Kathy Sierra on “how to grow and nurture your community”, the main idea that Kathy stressed was about creating a culture of passion among users to solve their tasks, its all about making the “users kick ass” rather then getting the “product to kick ass”, hand holding users to be champions is the only way to gain adoption and to maintain it. I have had Kathy’s book “Head First Design Patterns” for sometime but had not read it as yet, however after listening to her I came home and the first thing I did was to start reading her book :)

The most interesting stall was from Microsoft because of Microsoft Surface, it was my first look at this futuristic invention, very very interesting, viewing the demo of Microsoft surface I am quite sure that we will be seeing more of them pretty soon. Considering that it costs 15,000 dollars a piece I don’t think its going to be a big investment for hotels, pubs etc to use it as a customer attraction.

Since I have been working with REST in WCF now a days and have had some issues getting the required information, I discussed it with Mike Taulty at microsoft and he was very kind to guide me towards Astoria Data Services to sort out our requirements.

Listening to QA with Mark Zuckerberg, founder of Facebook was interesting and made me think the possibilities that the internet holds today.

Return Newely Created ID of Record using Typed Datasets

When Using ADO.net typed datasets, Visual Studio Automatically creates the Update, and Insert Methods, however the return integer value indicate if the record was added successfully or not, in order to get the ID of the newely created entry one can access the ID field of the original dataset that was used to add contents to the database.

In order to make this happen one needs to enable “Refresh the data table” in Advanced Options

once done, on update the source datatable contents will be updated with the inserted Id of the new record.

[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public int AddModule(dsDomainModules.tblDomainModulesRow Module)
{
int nResult = 0;
try
{
dsDomainModules.tblDomainModulesDataTable objModule = new dsDomainModules.tblDomainModulesDataTable();
objModule.AddtblDomainModulesRow(Module);
if (_dsDomainModulesTableAdapter.Update(objModule) == 1) //update was successful
nResult = Module.nModuleId;
}
catch (Exception ex)
{
//do something with exception
}
return nResult;
}

REST in WCF

While reading Joe Stagner’s blog I came across a very interesting screencast series about using RESTful services using WCF, after going throw few of them I realized how easy it was to put a RESTful service infront of your existing API, The list of screencasts from Rob Bagby can be found on his blog or at Joe Stagners blog post.

Using NUnit with Visual Studio 2008 Class Library

Class library are a bit harder to debug compared to dialog based or command line based application. After deciding to use NUnit I was using a dialog based application to instentiate my class library debugging, however there is a much easier way of doing that

1) Create class library with unit tests

2) Take properties of the class project in visual studio, and select the debug tab. properties -> debug

3)  Set Start external program to C:\Program Files\NUnit 2.4.1\bin\nunit.exe or whereever you nunit executable is placed.

4) Set the test library as startup project.

5) Start debugging the project, it will bring up the nunit test application, if there are breakpoints in the application it will break into it.

Silverlight 2, WPF and .net client profile

I attended the MS event “Rich Internet Applications with Visual Studio 2008 Service Pack 1″ presented by Mike Taulty , I was quite impressed with new features of Silverlight 2 and WPF. My understanding was that WPF could only be used in windows desktop applications, but it turns out that it can be compiled to be run as a application running of a web server. However the big draw back in my view was the requirment of windows XP (SP 2) / Vista  and presence of .net framework on the client machine, I can understand why the dependency was but from a pratical point of view I find it very limited. Only big enterprises with MS intrastrucure will be inclined to develop using WPF as a web based solution.

.NET Framework Client Profile is a cut down version of .net framework, created to support web based and windows deployment, but still being 28 MB in size is quite a lot, and I do not see people waiting for a 28 MB install before they can view a web page unless they are forced to do it in an intranet environement.

Over all I found the features impressive and using XAML at the backend means they are interoperable as well, which is great.

Looking forward to getting my head into silverlight 2.

Windows DreamScene is nice

Although of not much real use, but at times I do like to play around with my desktop background, while checking the windows updates I came across Windows DreamScene , which was listed as one of the optional updates, curious about what it is, I did some googling and came across a detailed page explaining that DreamScene allows you to use alternate multimedia like Video’s as your desktop background, I ended up installing the optional software, and once enabled got a waterfall video showing up as my desktop background, very nice and relaxing for my nerves, but unfortunately this feature is only available with Windows Vista Ultimate (Installed at home PC), and I have business addition at office, otherwise it would have been nice to setup a nerve calming video as my office desktop backgroud, so that each time I minimize my applications I can see the video of my last summer holiday :)

Video background using DreamScene

Video background using DreamScene

Install an Assembly into the Global Assembly Cache

On Windoze one can install assembles into Global assembly cache to make assembly accessible from everywhere on the machine, there are four main ways to install assembly into global assembly cache , but the one that I found to be the easiest and available by default on windows is the Assembly Cache Viewer (Shfusion.dll) , using this method one can use windows explorer to drag the assembly file into the global cache folder at windows\assembly however this method requires that the assembly is strongly typed, in order to do that one has to sign the assembly, In Visual studio this can be done by click on the class library project properties and select Signing tab and then selecting Sign the assembly.

Note: On Windows Vista I was getting Access denied message on trying to use Assembly Cache Viewer although I was performing the copy using Administrative rights, and ended up using .NET Framework Configuration Tool (Mscorcfg.msc) which worked like a charm for me. So if you are getting the same issue better try using the alternate ways of installing the assembly .

Enabling Sharepoint Intellisense in Visual Studio 2008

Styling Sharepoint sites depends heavily on creating and editing XML files that need to follow sharepoint schema.

the first thing to note is if WSS (Windows Sharepoint Services) are installed on the same machine as you Visual Studio on not, Microsoft suggests to develop Sharepoint application on a windows server 2003, so that debugging and testing is facilitated.

If Visual Studio is on the WSS machine then all you need to do is create a xml file e.g sharepoint.xml in the folder Program Files\Microsoft Visual Studio 9.0\Xml\Schemas

Place the following code in it

[code]

<SchemaCatalog xmlns=”http://schemas.microsoft.com/xsd/catalog”>
<Schema href=”%CommonProgramFiles%/Microsoft Shared/web server extensions/12/TEMPLATE/XML/wss.xsd” targetNamespace=”http://schemas.microsoft.com/sharepoint/” />
</SchemaCatalog>

[code]

Restart Visual Studio and add the following line to your top most element xmlns=”http://schemas.microsoft.com/sharepoint/” in your XML file this should enable intellisense in your XML file.

For Environments where WSS is not installed on the same machine, wss.xsd file can be copied to the development machine and the above code altered to point to the xsd file location.