Wednesday, October 21, 2009

SharePoint2010.Microsoft.com & SharePoint2010 Resources


Since last 2 months Me and my team went through an exciting journey of migrating the existing Sharepoint.Microsoft.com site (which we created a while back) to the upcoming version of SharePoint, i.e SharePoint 2010.

image

When we started the project, the product was hardly in its beta stages. So we had a bit of struggle initially to understand some of the advancements but overall with the excellent support from out college Todd and the MS team we not only understood the product well but also successfully launched the site just before the SharePoint Conference 2009.

There are various materials out now to know more about SharePoint 2010.

Andrew Connell has posted some great articles on his blog explaining some of the new advancements done in the product :

There are bunch of resources including the SharePoint 2010 (Beta) Developer center and other links on the Microsoft SharePoint Team Blog as well as,
Paul Andrew has posted some really good links of a white paper by David Chappell, SharePoint 2010 Developer Platform Post and many other resource links here

We are about to start the Phase II of the project and would be adding cool new features on the 2010 site showcasing some of the new advancements of the product, so stay tuned . . . . . 

Sunday, October 04, 2009

VS2010 & .NET 4.0 Sneaky Features


A must watch features Video from Mr. Guthrie himself on VS2010 & .Net 4.0 

  • Parameter Usage Highlighting
  • RegEx based Intellisense Filtering
  • View Call Hierarchy for Methods
  • Vertical Text Selection
  • Consume First Intellisense Mode
  • Snippets for Markups & JavaScript
  • Debug History
  • .Net 4 (New CLR)
  • Search Project Templates on Online Gallery
  • VS Web Development (Code Optimized) Profile
  • URL Routing in Web Forms
  • IIS SEO Toolkit
  • XML comments in Intellisense within JavaScript file
  • Dynamic named variable Intellisense in JavaScript
  • T4 Template customization in ADO.net Entity Framework
  • LINQDataSource + QueryExtender Control
  • DynamicValidation of data
  • New Markup Syntax for automatically HTML encoding . . <%: Message %>

Lots more in the Video so check it out. . . .

Monday, September 07, 2009

Diving & Exploration


Gems which I found last month :
  1. Scott Hanselman's 2009 Ultimate Developer and Power Users Tool List for Windows
    If you are a MS developer you would know Mr. Hanselman and this popular post series wherein he lists out some of the most powerful tools for windows.
  2. 50 Windows 7 tips, tricks and secrets
    One stop shop of all the cool features of Windows 7.
  3. Cloaking your ASP.NET MVC Web Application on IIS 7
    Here Howard explains the security aspects of a publish facing web application and how we can change the header information of an ASP.net MVC application on a WISA (Windows, Internet Information Services, SQL Server, ASP.NET) Platform
  4. The role of a hands-on software architect
    This is an excellent article from ‘coding the architecture’ community explaining - “What should a hands-on software architect do?” in various aspects of project life cycle.
  5. 10 Things Every Software Architect Should Know
    This is an excerpt from the Richard Monson-Haefel’s 97 Things Every Software Architect Should Know,  where he collaborated with over two dozen authors to collect 97 axioms of software architecture

Friday, September 04, 2009

SOS debugging extension on 64bit Applications


Recently I got into a problem running the SOS on a 64bit Virtual Machine. Visual Studio gave the following message :

---------------------------
Microsoft Visual Studio
---------------------------
Error while trying to run project: Unable to start program '<app path>'.

The debugger does not support debugging managed and native code at the same time on this platform.
---------------------------
OK  
---------------------------

Binging’ around I found that there is a known issue in Visual Studio 2008 Mixed Mode Debugging for 64bit Applications. Since to run the SOS we have to ‘Enable unmanaged code debugging’, hence the issue.
The only way I could make it working with VS 2008 was by changing the Platform Configuration to x86.

Tuesday, September 01, 2009

Spec# - Code Contracts in .Net 4.0


Spec# is a formal language for API contracts (influenced by JML, AsmL, and Eiffel), which extends C# with constructs for non-null types, preconditions, postconditions, and object invariants.”

Code Contracts is a library which provides a language-agnostic way to express coding assumptions in .NET programs and would be included as part of the base class library in .NET 4.0. The contracts can be called as a subset of Spec# and take the form of preconditions, postconditions, and object invariants”

Let’s see how an we leverage code contracts. After installing the code contracts create a new VS Project (I used a console app here) and add the reference to ‘Microsoft.Contracts.dll’, which you would find in ProgramFiles\Microsoft\Contracts\PublicAssemblies\v3.5. Then enable the Static Contract checking in VS (which is the whole purpose of contracts, validating things at compile time rather than runtime). Goto –> Project Properties and you check the options as shown below :

image  

Now lets see some quick examples of precoditions, postconditions and object invariants . . .

Preconditions - What does it expect? As the name suggests, precoditions are contracts to ensure that the expected data is provided while performaing an operation.
e.g. :
image
Postconditions - What does it guarantee? Postconditions are contracts to ensure certain conditions are met just before exiting an operation.
e.g. :
image
Object Invariants - What does it maintain? Object invariants express the conditions under which the object is in a good state.
e.g. :
image
(In the above customer class we have an invariant contract to check that the ID should always be greater than zero, which is being called after each public method calls and validated)
Interface Contracts
Code contracts can also be applied to Interface methods by creating a sealed classes as shown below :

image
There are many other methods in the Contract class which could be used in many other scenarios. Checkout the documentation of this library and Matthew’s blog post for more details.

Sunday, August 16, 2009

Gartner's 2009 Hype Cycle


Last week ‘Gartner’ published its 2009 Hype Cycle report which is by far the Largest to Date With the Expansion of New Topics. Gartner, Inc. has examined the maturity of 1,650 technologies and trends in 79 technology, topic, and industry areas.



No doubt ‘Cloud Computing’ is at the peak of the hype since almost every major players in the industry are talking about it and building their long term strategy around providing cost effective and reliable services over cloud.

It is interesting to see that Surface Computers and 3-D Printing are climbing high while Microblogging and Green IT are slopping down the peak.

Here is the detailed analysis of the report and if you have seen this report first time read these details to better understand the report.

Wednesday, August 12, 2009

First Look at - Silverlight SDK for Bing


Recently I downloaded and tried the ‘Silverlight SDK for Bing’. The SDK includes a very cool application with it, which basically demonstrates some of the new controls from View Control Toolkit and some of the advanced data metaphors shown in the Bing search component. Here is how the application looks :

image
with search results . . .

image

The most interesting stuff that I found in the SDK is the View Control Toolkit, which includes many reusable  controls for Silverlight for overall enhancing the visual metaphors. Below are some screenshots of those views :

  • StackView : This is very similar to a Listbox but the cool thing in StackView is that it has a build in vertical blind-style animation for each item, which fires in sequence as the items are added.
    image
  • TileView : This control also has a cool seek-from-origin style animation for each item, which fire in sequence as the items are added.
    image 
  • CloudView : This view displays the results with dual axis, one being Relevance and other is configurable based on data type. CloudView also provides a simple magnification function so that items can be magnified when clustering occurs
    image 
  • BandCloudView : This view enhances the cloudview by providing a configurable vertical and horizontal axis and an extensible model using flexible data binding and sorting. The difference between CloudView and BandCloudView is that in CloudView, items are arranged free form across a fluid Cartesian surface. In BandCloudView, items are arranged in vertical bands based on granular division. Items in each band are arranged horizontally within each band as if each band were a horizontal list. It also has a cool item animation, which animates the items from the center of the view at data binding time.
    image

The crux of all the animations in all these views is the “MultiView” control which essentially is a stack of MultiView Panel controls which animates panels into views.

The SDK also includes a detailed help on all the components with examples in both C# and VB. So to get started first you would need to create a Bing AppID, then download the Source Code and change the AppID in the SearchEnvironment.cs file - line 105 and get silvery binged  :-). . . . .

Wednesday, July 29, 2009

Managing Azure Storage with ‘Cloud Storage Studio’


Recently I had an opportunity to explore the private beta of ‘Cloud Storage Studio’ by Cerebrata

Cloud Storage Studio is a WPF app which allows you to manage your tables, queues and blob containers for Windows Azure Storage. Although there are limited features right now in the app but I really liked the overall simplicity and ease of use. 

 image

Also there are various configuration settings available which can be applied on all Tables, Queues and Containers like Maximum Tables, Entities, Queues and Blobs per Request, Request Timeout.

The one that I liked the most is the Block Size Settings for Upload/Download Blob Size. This is very important when you are uploading a large chunk of blob data. The CSS would automatically divide a large Blob data in block based on this configuration so that its faster and easier for uploading.

image 

I would definitely recommend everybody to get its private beta from here,  try out yourself and provide your valuable feedback as they are really listening with big ears :-)

Also I had a chat with Gaurav Mantri (owner of Cerebrata) about the upcoming features and vision of CSS and believe me it was super exciting, so please stay tuned and keep your eyes on this . . .  

Thursday, July 23, 2009

“Gestalt” - Writing XAML code inside your HTML


Gestalt is a library released by MIX Online Labs that allows you to write Ruby, Python & XAML code in your (X)HTML pages. It enables you to build richer and more powerful web applications by marrying the benefits of expressive languages, modern compilers, AJAX & RIAs with the write » save » refresh development model of the web.”

My First Thoughts:
· It’s a great entry point for someone to learn and try out XAML (especially for web designers)
· It is not so intuitive for building complete business apps in something like silverlight

Any more thoughts are welcomed  !!!
Cheers . . .

Monday, July 13, 2009

SharePoint 2010 Sneak Peek . . . .


Last 2 weeks were full of excitement, thrill, lots of sleepless nights and several barrels of fluids . . . . all this for :

image

The SharePoint 2010 Sneak Peek site is launched today. The site previews some of the upcoming features in SharePoint 2010. Again a good project completed with an excellent team . . .

Cheers . . . . .

Saturday, June 20, 2009

Opera Unite - Reinventing Web?


Opera Unite : “A new technology that shakes up the old client-server computing model of the Web”.

Opera unite provides the following services:


Here is good post on installing and configuring these services. The only service that I felt interesting was the ‘Web Server’. So I tried it and the first cut really went well. Below is the link of a file hosted on my laptop by unite:
http://home.jomitvaghela.operaunite.com/webserver/content/

My first impression:
While the services being offered are not at all new, the crux here is the ease of sharing this from your own device using a simple browser.


Try it out yourself and share your thoughts. . . . .

Friday, June 19, 2009

Rebuilding Microsoft.com/SharePoint


Since last couple of months I, along with my wonderful team including
Todd, Vivek, Meeta and Ritu had been working with Tony on rebuilding the Microsoft's SharePoint web site.

The web site went live last month :
http://www.microsoft.com/sharepoint . . . .


and now, there is also a 'How we did it' article on MSDN describing goals and technicals details of how we developed all the pieces and fitted it together.

Tuesday, June 02, 2009

Loading .xap files OnDemand using Composite Client Application Guidance (PRISM)


One of the challenges of porting large business applications on silverlight is the size of .xap file. A typical business app would have multiple screens, rich data visualization and lots of user interaction which would in turn increase the overall size of the xap file. Also it would have users with multiple roles and each role would have specific permissions to specific screens. 
So wouldn’t it be nice to divide the entire app into multiple silverlight modules and than load them only when required  ? This is where PRISM can help us . . .

Composite Client Application Guidance (PRISM) provides us a rich framework to divide a silverlight application into various Modules and also load them ‘on demand’. A module can be a separate silverlight app. You can watch Erick’s video for creating the basic structure of a PRISM Project.

The solution structure for our scenario would be a bit different with multiple Silverlight Applications linked to a Single Web App as below :

image

image

Now what we need is a Default View which would be loaded first and than some triggers/events which would load the other on-demand views. 
In our case “DefaultView” is in “MyPortal” app and the “VoterModule” inside MyVoterModule Application would be loaded on-demand when a button is clicked from “DefaultView”.

Next, we need to add our Modules into the ModulesCatalog :

image

ModulesCatalog.xaml

 image

The important thing to note here is that we can create groups of modules and than can specify when do we want to initialize the modules being loaded in that particular group. We can also add modules via code instead of loading it from a xaml file.

Than we need to create some event on the DefaultView which would load the VoterModule. I have created a simple button as under, but we can also add more complex business logic to drive the loading of modules :

image

That’s all we need. The VoterModule would add the appropriate view onto the region and since we have specified to load this “OnDemand” the entire .xap for that application would be loaded when we click on the button.

We can also verify this using Fiddler . . .

Sunday, May 10, 2009

Diving & Exploration


Internet is like a deep ocean with many hidden gems so I just thought to wear my scuba suit and find those gems and share them. This is what I found last month :

Sunday, March 15, 2009

Re-Sizing .VHD Files


While creating a Virtual Disk (.VHD) for Virtual PC we need to allocate a maximum size for both Dynamic and Fixed sized disks. Now once we set this size it’s really difficult to change it. I had a similar issue last week and luckily I happen to find a solution for it which I am going to share here.

Firstly we would need the Vhd Resizer tool from the vmToolkit. This tool would copy sector by sector all the contents of a VHD and create a new VHD with the new size.

vhdresizer

Once the resize is complete the added GB’s/MB’s would be shown as an unallocated partition in the new VHD file. (To view the partitions, start the VPC (with the new VHD) -> Right Click My Computer > Click Manage -> Disk Management)
Now to merge this unallocated partition we need to use a command line utility ‘diskpart’ as follows:

Open command prompt and type diskpart, press enter and you would get this prompt

diskpart

· Type list disk (this would list all the disks)

· Type select disk # (select the disk number in which you want to merge the unallocated partition)

· Type detail disk (this would display all the volumes of the disk)

· Type select volume # (select the volume number in which you want to merge the unallocated partition)

· Finally Type extend (this would merge the unallocated partition on the selected disk & volume)

Open the Disk Management again and you should see the new size of the VHD. We can also use other tools like Partition Magic for merging the unallocated partitions.

Friday, March 06, 2009

How to create context menus and capture right click event in Silverlight


Context menus & right click event is something which is not out of the box supported in silverlight but I think they prove to be very crucial while developing LOB applications. So here is a workaround on how you can create them. Basically I am using HTML/Javascript to create and render menus on top of silverlight but it involves a few tweaks which are listed below.

First tweak is – How to display a HTML Menu on top of silverlight control.
For this we need to change 2 properties on the .aspx or .html page where the silverlight control is being hosted.

      <param name="background" value="transparent" />
  
<param name="windowless" value="true" />


Than capturing the right click event in HTML and displaying our menu.

<
script language="javascript">

  function click(e) {
     if (navigator.appName == 'Microsoft Internet Explorer' && event.button == 2) {

                var menu = document.getElementById('myMenu');
                menu.style.left = event.clientX + 'px';
                menu.style.top = event.clientY + 'px';
                menu.style.visibility = 'visible';
                return false;
            }
            return true;
  }
  document.onmousedown = click

</script>

'myMenu'
is a <div> I have created on the html page which contains a simple table as below:

<
div id="myMenu" style="position: absolute; visibility: hidden; width: 75px">

   <table width="100%" style="background: #000000" cellspacing="1" cellpadding="1">
    
<tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand">
             
Edit
        
</td>
    
</tr>
     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              Save

        
</td>
    
</tr>
     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              ________

        
</td>
    
</tr>


     <tr style="background: #FFFFFF">
         <td onclick="SomeFunctionWhichCallsSilverlight()" style="cursor: hand"> 
              Exit

        
</td>
    
</tr>

   </table>


</
div>

The SomeFunctionWhichCallsSilverlight() function would be the interop function to call the relevant Silverlight function as described in my earlier blog.

Now the last thing is to disable the default ‘SilverlightConfiguration’ menu

<body oncontextmenu="return false">


You can download the sample code from here

Monday, February 23, 2009

‘OneNote on Cloud’ – First bits deployed on MESH


I have deployed the first bits of my OneNote application on Cloud. Currently I have created a very basic version with Pen / Text for writing the notes.

onenotemesh

Overall the aim is to get the know how of Windows Azure platform including .Net Services, Mesh Enabled Web Applications (MEWA) and SQL Data Services.

 image

I have already created the SDS Proxy WCF Service. So the next step is to configure and deploy it on Azure. Than finally to tie all the pieces together . . .

Wednesday, February 18, 2009

Accessing SQL Data Services from Silverlight


“OneNote on Cloud”…  This is something I have started exploring on since last couple of days. 
The idea is to have a OneNote type application experience on web, using Silverlight and SQL Data Services.

The first hurdle was to access SDS from silverlight. We can’t directly use the SDS from silverlight because of some known limitations. So the option that I thought of was to use some Proxy Services in between the Silverlight Client and SDS, which was also suggested by the guys who developed the Omega.SDSClient

Now there are few gotchas while developing these proxy services for silverlight client which I am listing below :

  1. We need to Change the service bindings to ‘basicHttpBinding’ as silverlight doesn’t support any other bindings.
  2. We need to set the AspNetCompatibilityRequirements attribute to ‘Allowed’ for all the service implementations
  3. (If we add the services using the ‘Silverlight-enabled WCF Service’ template than the above changes are done automatically.)
    silverlightenabledservice 
  4. The last thing is to add the cross-domain policy file at the root of in case of IIS hosted services it should be on the root of the mapped directory. 

     crossdomainfile

    The important thing to note in this file is the SOAPAction headers which are required to be enabled for SOAP based messages transfers from silverlight.

Friday, February 06, 2009

Getting started with ‘Microsoft Surface’ development


This week I went on a roller coaster ride of formatting & configuring my laptop for Surface development. I will just brief out the steps that I had to do before installing the Surface SDK 1.0 :

(You would need a monitor that is capable of 1280 × 960 screen resolution or a widescreen monitor that is capable of 1440 × 900 screen resolution to start the Surface Simulator)

Now lets build our first surface application using Visual C# 2008 Express Edition :

  1. Under the Create New Project you should be able to see couple of VS Templates for surface apps:

    new project 
  2. Select the Surface Application (WPF) and you would see the default template as below :

    template
  3. The First interesting control to look at is the ScatterView control.
    (The ScatterView control is the control that you should use when you have one or more UI elements that you want users to be able to move, rotate, or resize freely within a fixed area)

    scatterview
  4. Once you build the application first open the Simulator and than press F5 to run the application and it would automatically get displayed on the simulator . . .

    surface
    As you can see I have added multiple fingers on the screen so you can use your mousepad (on laptop) and your external mouse as two fingers and than can stretch or rotate the images . . . .

Enjoy Learning !!!

AddIn