I downloaded VC 2010 RC on 11th Feb and was so happy with the performance compared to VS 2010 Beta 2 till I came across the VS 2010 crash due to IntelliSence issue.
My good old friend Ludmal was kind enough to direct me to the “VS 2010 RC IntelliSence crash issue Patch” published in ScuttGu’s blog.
Happy Coding!!
Tuesday, February 16, 2010
VS 2010 RC IntelliSence Crash Issue Patch
Saturday, February 13, 2010
Code Snippets in Visual Studio 2010
Expansion – This type of snippet is inserted at the curser.
SurroundsWith – This type wraps around the selected code block.
Add a XML file to your project and name it as verHeader.snippet. (.snippet is the extension of snippet files)
<?xml version="1.0" encoding="utf-8" ?> <CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <Header> <Title>Code File Header</Title> <Author>Prabath Fonseka</Author> <Shortcut>codeHead</Shortcut> <Description>Adds a header to a code file.</Description> <SnippetTypes> <SnippetType>Expansion</SnippetType> </SnippetTypes> </Header> <Snippet> <Declarations> <Literal> <ID>Author</ID> <Default>Prabath Fonseka</Default> </Literal> </Declarations> <Code Language="CSharp"> <![CDATA[ /**************** Code File Header ****************** Author: $Author$ Date: Version: Description: ****************************************************/ ]]> </Code> </Snippet> </CodeSnippet>
Go to Tools > Customize > Commands > Tools > Add Command…
By default Menu bar: radio button is selected, select Tools from the dropdown.
Happy Coding.
Thursday, December 17, 2009
Bing for iPhone
I did my last post when I got to know Microsoft is developing Bing and Messenger for iPhone. Today I was lucky to get my hands on Bing for iPhone. If there is something that the word awesome is not enough, I would happily use Masterpiece to describe it. :) Yes “Microsoft Team iPhone” you’ll have done a tremendous job by designing and developing Bing for iPhone. Glance through the pics below, you’ll see how feature rich and eye catching the app is.
First screen of the Bing for iPhone
Filter your search by Web, Images, Movies, Maps, Businesses, News, etc…
Pic below shows how the voice search works.
Setting screen.
Image search results.
Web search results.
Apple.. Microsoft.. you made my day. :)
Tuesday, December 8, 2009
Bing and Messenger iPhone Apps
“If you can’t beat them, join them”
Microsoft is working on two new applications for iPhone. Microsoft Bing and Live Messenger Apps for the revolutionary phone.
Both applications are likely to be released alongside the upcoming Windows Live Wave 4 updates due in approximately March 2010. Last week Microsoft principal group program manager David Raissipour confirmed to Cnet news that "We are actively working on it" when questioned over the Bing iPhone plans.
Friday, December 4, 2009
How the Windows 7 start up animation evolved
Recently I saw this article on how the Windows 7 start up animation evolved and not to forget, the person behind the Windows 7 start up animation, Rolf Ebeling.
“Having only been with the company for four months and suddenly finding myself working on the first thing millions of people would see when they started up Windows 7 … was a peculiar realization to wake up to each morning,” Ebeling says.
Monday, November 30, 2009
Knowledge Sharing with Peradeniya Engineering Undergraduates
As for my understanding it’s the most beautiful University in Sri Lanka, the Peradeniya University. Thanks to Microsoft Technology Evangelist Wellington and Dinesh Priyankara (MVP – SQL) I got a chance to host two technical sessions for Engineering students at Peradeniya University.
First session was an Introduction to .NET Framework and Visual Studio IDE hosted by me. Windows Server 2008 and IIS was done by Susantha Silva. Third session which was an Introduction to MS SQL Server was done by Dinesh Priyankara (MVP). Back again the fourth session was a Deep Dive session which was on LINQ (Language Integrated Query) done by me. Wellington hosted a session on Silverlight. Also not to forget, Tharindu Nanayakara explained the importance of communities-Student Champ.
Well, it was a good experience as 99% of the students were from an open source background. But I’m sure they were so impressed seeing the new UI and features of Visual Studio 2010. One thing that worries me is, I didn't have enough time to go through all the wonderful features of VS 2010.
Presentations are available to download…
Some pics of the event after the break.
Many thanks to Chanarangana Rathnayake and all who supported to make the session a success.
Tuesday, November 24, 2009
Microsoft SharePoint 2007 Development – SharePoint Object Model
Functional Areas of Object Model
According to the functionality of SharePoint there are different namespaces given to manage and customize SharePoint using Object Model.
List Management
List is more like a Table in a Database. Of all the tasks a SharePoint programmer can do in SharePoint, working with Lists is the mostly common task.
Namespace: Microsoft.SharePoint
Classes: SPList, SPListItem, SPListItemCollection
Document Libraries
This is a special type of list created to store documents. Managing and storing different types of documents, pictures and files will be handled within SharePoint Document Libraries.
Namespace: Microsoft.SharePoint
Classes: SPDocumentLibrary, SPPictureLibrary
Sites
Site Collections, Sites, Web Collections and Webs which is obviously bit confusing tough is an area developers should have a clear understanding.
Namespace: Microsoft.SharePoint
Classes: SPSite, SPSiteAdministration, SPSiteCollection, SPWeb
Features and Solutions
With Features and Solutions it’s dramatically easier to customize sites and site collections. Features provide the ability for sites to reuse functionality that exists in other sites without manually copying and pasting XML code from one template to another. Solutions package Features in a cabinet (.cab) file and define important metadata about the included Features.
Namespace: Microsoft.SharePoint, Microsoft.SharePoint.Administration
Classes: SPFeatureDefinition, SPElementDefinition, SPFeatureProperty, SPFeatureScope, SPFeature, SPSolution, SPFeatureReceiver, SPSolutionCollection
Business Data Catalog
BDC is the most recommended way of Integrating Enterprise Data in to SharePoint. ERPs, Different Data sources, your own in house applications, BDC can cater the integration with SharePoint.
Namespace: Microsoft.Office.Server.ApplicationRegistry.Administration
Classes: EntityCollection, ApplicationRegistry
Meetings
SharePoint has used Meetings to provide collaboration within organizations. Meeting Workspaces provide websites dedicated to supporting and maintaining meetings, meeting information, attendee lists, minutes, meeting-related documents, and much more. (Meting workspace is a web template installed with default SharePoint installation)
Namespace: Microsoft.SharePoint.Meetings
Classes: SPMeeting, MtgUtility
User Profiles
User Profile is used to create, update and manipulate user profiles and profile properties which is way beyond storing basic information of an individual user but which also provide features for community building social networking, etc…
Namespace: Microsoft.Office.Server.UserProfiles
Classes: UserProfile, UserProfileManager
Windows SharePoint Services Server Architecture
In relation to the collections and objects of the Microsoft.SharePoint.Administration namespace the SPFarm object is the top most object in the Object Model hierarchy. Servers and Services properties represent the collections of each. Each SPServer object represents a physical server machine.

Windows SharePoint Server Site Architecture
The diagram below shows the site architecture in relation to the collections and objects of the Microsoft.SharePoint namespace.

Microsoft.SharePoint.SPSite.OpenWebmethod of the SPSite class returns a specific Web site. Each site collection includes any number of SPWeb objects, and each object has members that can be used to manage a site. Each SPList object has members that are used to manage the list or access items in the list. Each SPField object has members that contain settings for the field and each SPListItem object represents a single row in the list.
Development Environment
Well, when SharePoint development is concerned you can setup the development environment in two different ways, remote and local. Each has its own pros and cons. In this article I’m not discussing how to setup those two development environments rather I’ll show how to cheat by setting up a remote development environment despite debugging and easy testing, to try out your first SharePoint application developed by you.
First tool you need is Microsoft Visual Studio 2005/2008. If you are not a licensed user of Visual Studio please download the Express edition for free from Microsoft site. Setting the development environment remotely is simply a development environment that is not on a SharePoint server.
After setting up Visual Studio, open a new Console Application project. Now let’s get to the cheating part of copying the required assemblies from the SharePoint server to your development machine. Browse to the location:
[drive]:\program files\common files\microsoft shared\web server extensions\12\isapi
Copy the Microsoft.SharePoint.dll assembly (only assembly required for the test application) and add reference to the assembly in your project.


The SPSite constructor used in the preceding code obtains a reference to the site collection contained at the given url (http://sharepointsvr:4488). You can access the web application to which a given site collection belongs using the WebApplication property, which is of type Microsoft.SharePoint.Administration.SPWebApplication. http://sharepointsvr:4488 is where my SharePoint server is. 4488 is the port number. Change yours accordingly. Given below is the result I see in the console window.
Root collection found at Url http://sharepointsvr:4488 is part of Web Application SharePoint - 4488
Hit F5 and check out the output in the console window. WAIT!! You are on a remote dev machine if you followed me till now. Let’s deploy your application.
Application Deployment
For a Windows or Console SharePoint application there’s no difference than a standard application deployment. Either you can create a Click Once deployment. You can simply copy the application and its dependencies (no need to copy the SharePoint DLLs as it’s already there in the server) in to the SharePoint server and checkout the output.
But if you are developing SharePoint applications commercially make sure to follow a proper development & deployment process covering the QA stage.
Summery
SharePoint Object Model is a very powerful application programming interface (API) which gives developers the ability to control virtually every aspect of SharePoint through managed code.