Automatic file checkout is missing in VS2010 and TFS

I have recently came to a strange behavior. I am using VS 2010 (ultimate edition) and TFS 2010. In past the  with VSS when even I edit any file it gets automatically checked out and see the small icon for it in with filename.


Now I do not get it any more Sad smile

Reason: You solution is not binded with the source control.


1. Go to File—> Source Control—> Change Source Control




2. Select all the projects in your solution file and BIND them . 



That’s it


VS2010 causes blue screen error on windows

VS 2010 uses the WPF hardware acceleration . This causes   famous blue scree error (depends  on hardware ).

Below is a fix which worked for me :


1. Go to VS 2010 Tools->Options


2.  Go to Environment –>  General

  Disable Visual experience check box.



How to use Team Foundation Server 2010

Today we will talk a little bit more about Team Foundation Server 2010. In my previous post about   TFS  I have gave an broad picture of  the server. Today we will concentrate more on “How to Use TFS in our daily development work

Whats is Souce Control?

Source control is centralize location where we can keep our files (code files etc). It provides possibility to maintain the revisions on any change in the file. Multiple people can connect to the source controls and work on files similtaneously.Ofcourse files can be compared for any changes against any revisions.

There are many options for source control  i.e. Tortoise SVN etc.

TFS provides inbuilt source control , t means we actually do not need any other source control tool seperately . The beauty of this integration is that now we can link our workitems with evey change  we checkin into source control.

Please go through below attached screen shots to get more details for wuestions like

  • When to Check out for edit and how to check out
  • Check in process
  • MErging two files
  • Checking in reference.
  • Comparing files
  • Veiwing history.
  • Get Latest version
  • Get Specefic version.
  • How to connect to Team Explorer

Steps :

1. Open your VS IDE and you will see “TEAM” option menu  and connect to your TFS server .

2. ONce you have connected TFS server you will in your VS IDE as shown below




3. Now files are connected to the source control


4. To get latest version. check out etc  operation right click o the file and choose your option


5. Checked-out file

6. Right click on checked out file and choose your option i.e View Pending  changes, Check in etc. Compare etc.




Have a nice day!!!







ASP.Net GridView sample

Here is a quick sample to use Asp.Net GridView without any coding.

I have used VS2010 ,.Net framework 4.0.

Steps :

1. Start your VS ans create new web site project. This will create a default application template

2. Right click on the website and select “Add New Items”. Add ADO.Net Data Entity.

folow the wizard as shown in the screens below .


This will connect to your database (in my case Northwind sample database  . This can be download from here)

Note : See the option to automatically generate operation for CRUD operation.

4. Now go to VS tool bod  and drag and drop a gridview control on the page. and cnfigure it as shown in the below screen shots


5. Hit F5 and thats it . You see  Grid as shown below .


6. Paging  and sorting is also integrated .

Please click here to download the code for this small application. Please change the connection string to your databse in web.config to  run this sample.

Nhibernate ,Fluent nhibernate and Repository Pattern works great together

As I am trying to take a deep dive in Nhibernate world since last month , I have read a lot of articles and blogs .All were very good and some of them were really helpful. Well though all the stuff i have looked over internet was for sure interesting but i hardly find any of them who can talk about a running sample application(at least i didn’t find that ). So i have decided to try to write something which is simple and you can actually see it working immediately. I hope this will help to all those folks who are making their mind to have a look at this wonderful ‘state of art’ as i call it 😉

You can get details of how to download all required details to start form here

So lets start ..


When we start developing any business application , we talk about so many things .But i thing we never talk about how we will make our application speak with the database ???? One answer comes in  my mind for this question , if i ask it , is that “You stupid … is this your first time developing some application !!! humm..We off course will do it the same way , we are doing it since last so long time ..WRITE DATA ACCESS LAYER AND SCRIPTS“. So we really do not want to spend a lot of unnecessary time on discussing this obvious part of application.

Well when project start the UI and other modules are ready but….  We say GUYS LETS FIRST CREATE THE PROTOTYPE . Well needless to say in most of the cases, the project continues on the application created for the prototype.  Most of the time in developing an application is in writing Data Access layer and Scripts and offcourse to synch it with our so call Prototyped application.  It would be nice to have something which helps me to concentrate on writing my business application rather worrying how i will save this data in to the database..  ORM (Object Relational Model)is the answer .. Off course there are many ORM’s available on the web but i Nhibernate is one of the most popular one.


In this sample application we will implement the very basic scenario . I have Employee and Department entities .We also have a value object Address. The difference between Entity and Value object is that , value object do not have any identity but entities have identity. Employee and Department object shares many-to-one relationship . one department can have many employees.


In this sample we are going to implement a base repository so that we do not have to write similiar methods in for all the objects. I have created an iRepository interface of generic type and implemented in a base repository. With this approach we implement the  Repository Pattern

also, in our small application .

Nhibernate mapping

Nhibernate is an ORM and we need to map object with the data context properties.Generally Nhibernate provide support to do Mapping in an XML file xx.hbm.xml. This way we decouple our mapping from the business logic and data context.We can easily change the mapping in the xml mapping file.

Why Fluent Nhibernate

Well if Nhibernate already support mapping in xml file than why we need Fluent nhibernate  for mapping. Its not mendatory to use Fluent nhibernate in your application but its really helpfull to avoid  unnecessary changes/missing mapping.We  do mapping in c# code  so that if there is any change in the mapping than we get immediately a compilation error and its easy to fix the problem . Needless to say , compiler does not compile xml  so if there is any problem in mapping , we cannot find it in compile time.. and it can really take long time some time to identify the problem.

Component mapping

In Nhibernate we have <bag> node and it has its property. Fluent  nhibernate has similiar functionality and we call it component.

i.e Employee has Address properties but  we will save it the employee table so we need to map it as component in the EmployeeMap class.  All the mapping files are inheriting ClassMap which helps Fluent Nibernate to identify the mapping files .

public EmployeeMap()


Id(x => x.Id);

Map(x => x.Name);

References(x => x.Department);

Component<Address>(x => x.HomeAddress,

a =>


a.Map(x => x.Line1, “HomeAddress_Line1”);

a.Map(x => x.Line2, “HomeAddress_Line2”);


Component<Address>(x => x.WorkAddress,

a =>


a.Map(x => x.Line1, “WorkAddress_Line1”);

a.Map(x => x.Line2, “WorkAddress_Line2”);




Sample Application solution structure:
You can download  source code from here
Note : please change connection setting to tun the sample

Team Foundation Server 2010 details

I was in TFS2010 (team Foundation Sever 2010) seminar yesterday.The seminar was presented by 2 people from Microsoft, Germany I am looking for the best software development/management practices these days, so it was quite interesting for me . Till now I have seen SCRUM and RUP (Rational Unified Process). I am sharing few thing about TFS 2010 today .

What is Team Foundation server ?

Team Foundation Server is basically a collaboration tool for aligning more or less all the possible component/modules in a software development process. It automate and streamlines the software delivery process for all the team members . TFS is crafted in such a way , it can be even used by single person team, small team or globally scattered many small or large teams .TFS concentrates on putting the basic software development practices into the habit of a developer and it also covers the SCRUM practice. TFS has incorporated the SCRUM template also in this release.

Well what i like most is that now manager need not to ask their developers for the project status and developer need not to actually wait to get his/her tasks from someone. Project owner /manager can generate various kinds of reports and track the progress of the project in real time .So TFS is one stop shop for software developer and project managers both.

What was before ?

Till now , whenever we had any project we basically had these component considered :

  • Code Repository
  • Build Process
  • Task Allocations
  • Reports
  • Project management
  • Bug Tracking/Issue management
  • Knowledge repository
  • Test repository


Well we have to take care all of the above separately and its needless to mention the complexity and risk in it .

How TFS makes difference ?

TFS make all these separate component talk to each other. It works on a Process Repository component. TFS has a possibility to extend it further and interestingly it supports Eclipse now..I do not about you , but i was surprised by it ..:)

New Application Lifecycle Model (ALM) in TFS )

How it works ?

Microsoft has used some terminology in TFS to make it generic for all the process/projects. Out of many other artifacts there is one important artifact called “Work Items”. Its has “User Story” , which more or less a module and this has some Task under it . One task may had more User stories and those can have some another tasks.

So Task and user Story comes under Project implementation section .

MS has done a really nice job for the testing of the project Now you can really perform your testing very easily and later you can automatize is too.You can create bug in TFS directly whenever any test case fails and the testing is recorded in a Video (this is probably new in testing )

Various Reports

Testing Features (embedded in VS2010)

  • Playback action recordings and run coded UI Tests for Silver light 4 applications.
  • Edit coded UI tests using a graphical editor
  • Use action recordings to fast forward through manual tests that need to support Mozilla Firefox 3.5 and 3.6.
  • Run coded UI tests for web applications using Mozilla Firefox 3.5 and 3.6
  • Code visualization and modeling features
  • Use the Generate Code command to generate skeleton code from elements on UML class diagrams. You can use the default transformations, or you can write custom transformations to translate UML types into code.
  • Create UML class diagrams from existing code.
  • Explore the organization and relationships in C, C++, and ASP.NET projects by generating dependency graphs.
  • Import elements from UML sequence diagrams, class diagrams, and use case diagrams as XMI 2.1 files that are exported from other modeling tools.
  • Create links and view links from work items to model elements.
  • Create layer diagrams from C or C++ code and validate dependencies.
  • Write code to modify layer diagrams and to validate code against layer diagrams.

Integration ???

TFS directly talk with MS Office 2007/10 . Needless to mention that it has integration with share point too.

VS2010 Work flows

TFS 2010 Branching foundation Acrhitecture

Automation platform Support

Referrence :