Generate msbuild file from solution

Here is a quick way to generate a start up msbuild file from your solutions file.

Launch Visual Studio Command prompt and change directory to your project directory and then type the following 2 commands.
set MSBuildEmitSolution=1
msbuild <<your project>>.sln

This file will be generated next to the solution file, it wil be named .sln.metaproj.

All thanks to original post at


++ operator in VB.Net

We do miss the power of ++ operator in Vb.Net. Here is a quick way to achieve the same result
Use System.Math.Max(System.Threading.Interlocked.Increment(i),i – 1)
to achieve the same result as i++

Hope it helps!

How to run development server from command line

With help of couple of posts on web and

to run 2.0 webdev server, copy the following command in a .bat file

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Webdev.WebServer.exe /port:[PORT NUMBER] /path: [PATH TO ROOT]

to run 4.0 webdev server, replace the location of webdev server

“C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Webdev.WebServer40.exe” /port:[PORT NUMBER]/path:[PATH TO ROOT]

Hope it helps!



error : The Web Application Project * is configured to use IIS. The IIS Web server is not installed on this computer.

This problem arises when you try to load an existing web project, configured to run on IIS. A simple quick solution can be to open the project in a text editor and update the property UseIIS from True to False. <UseIIS>False</UseIIS>

Save the file and reload the project. This will enable you to use WebDAV server instead of IIS to run the application.

Happy programming!

How to get date 3 days before today

Its pretty simple really…



ASP MVC 3rd Party Controls

If you are looking for MVC Ajax controls to speed up application development, here are a few good ones,

I think the best are Telerik, not free


about USD 1999

And ofcourse with lit bit of effort and fun you can integrate Jq* controls such as Grid, Date, Autocomplete, Modal box

How to put comments in .skin files

Skin files, introduced in ASP.NET 2.0, make it easier to specify an application’s look and feel. Commercial developers will want to add a comment with their copyright notice, but Microsoft does not explain how to put a comment in a skin file. In his book “Programming ASP.NET 2.0 Core Reference,” Dino Esposito shows skin file content with an HTML comment, but that will cause a build failure in the release version of Visual Studio 2005.

Although a skin file looks like .aspx markup, it is highly restricted. However, it does recognize ASP code blocks and will accept code block comments, such as this example:

< % – - Copyright 2006 XYZ Corp. All rights reserved. – - % >

[Note: because of display limitations, characters "" here are shown with a space after or before them.]

– copied from

TFS Build Agent Unreachable

Today when I kicked off a TFS build I got an error:

TF215085: An error occurred while connecting to agent \#####\##BuildAgent: TF215076: Team Foundation Build on computer wd201a013v (port 9191) is not responding. (Detail Message: Unable to connect to the remote server).

The steps I took to resolve it.

1. Check if 9191 is added in the windows firewall exception list on the build machine. Control Panel > Windows Firewall. If not add an explicit rule to allow the port (9191 is default)

2. Check if Visual Studio Team Foundation Build service is running. Run > Services.msc > locate service if it running. If not start it. Visual Studio Team Foundation Build is the build service for Visual Studio Team Foundation 2008. If the service doesn’t start check the logon credentials. Make sure it is a valid Domain account or Workgroup account.

Problem Solved.

Pragma no-cache

I had a requirement where an aspx page should not be cached in the Temporary Internet Files, simply because we want to reload the page from the server each time. This sort of scenario may present when login or authenticating. Some research and I found this article

I was writing code in .Net and luckily its even simpler. Simply add this to the Page_Load

¬†Response.AddHeader(“Pragma”, “no-cache”);

Specify timeout in connection strings

Here is a quick way to specify the connection command timeout in the connection strings.

Use the property Connect Timeout  and specify a value to it. Here is an example of how this will look like in your application configs in

<add name=”MyConnString” connectionString=”Server=myserver; Database=mydb; User=sa; Password=mypass; Connect Timeout=20;” />

This is howevre only applicable to Sql Server connection strings.


Get every new post delivered to your Inbox.

Join 35 other followers