First Experience of tfspreview, connect to tfspreview using VS 2010

I am connecting to TFS preview account using Visual Studio 2010. To make it work, you must install

After you install the hot fix, then open VS2010 and Connect to Team Foundation Server.


Enter your tfspreview link, click ok and you will see the Team Foundation Server Sign-In window.


After you type in your credentials, you are connected.

FunnelWeb, a .NET MVC blog engine

I hope it will be something to fight against WordPress!!!

FunnelWeb is an open source blog engine, built by developers for developers. Instead of fancy quotes and oodles of widgets, we focus on letting you post beautiful code samples, keeping your markup clean and valid, and encouraging collaboration with rich comments. FunnelWeb is easy to install.

Download from :


Setup a private Nuget server, host your own Nuget feed

Before I start talking about how to create a private Nuget server, I need to show you how do you create a Nuget package by yourself.

To create a Nuget package, you can either use Nuget.exe command line tool to do it, or use Nuget Package Explorer. Nuget Package Explorer provides the nice neat interface to allow you create a nuget package without any knowledge of command-lines syntax. To download them both, from (Nuget.exe) (Nuget Package Explorer)

After you have created your own packages, you can now setup the private Nuget feed.

1. Create a web application in Visual Studio. I am using MVC as my Nuget server application.

2. Install “NuGet.Server” package from “Package Manager Console”.

3. Configure the package folders and ApiKey

    <add key="webpages:Version" value="" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
    <add key="apiKey" value="1234" />
    <add key="packagesPath" value="C:\MyLocalNugetFeed" />

4. Deploy your application to IIS. And you server is running.

To view the feed and download packages.

Right click “Reference” folder of your project, Click “Manage Nuget Packages”.


Then add “” as your feed address.

Adding new feed to package sources

You will be able to see your feeds in the list.

To publish a package

You can use Nuget Package Explorer or Nuget.exe.



Nuget Package Explorer, enter your publish Url and ApiKey then click Publish.


What are you waiting for to get your own Nuget feed and share code snippets or libraries with your mates!!

Here are some reference links may help you.

Modify or Override the default t4 templates in MVC

When you create a new View or Controller in a mvc project. It is T4 templates to generate the piece of code for a new view or controller.



The templates are located in

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3


C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3

We can bring these templates to our local project by dragging the “CodeTemplate” folder to Visusal Studio from Windows File Explorer.


You will see some compilation errors, these will be fixed after you have clear all the templates’ property “CustomTool”. Just clear the string out.

You can add your own templates as well. Next time when you add a new view, or controller, you will see the project is using your local templates to create them.

This is very helpful and I have Learned this trick from Scott Hanselman.

Here is the blog entry from him, if you want to read more about it.

Windows Live Writer, the best plugin to insert source code

I have been having problems for publishing blogs from WLW (Windows Live Writer) when there are source codes embedded into the blog. It is always formatted poorly or messed up in html.

Here is the syntax we need to use for WordPress to format our source codes.


And it doesn’t look right if I post the blog using WLW (Windows Live Writer), and I figure out I need to modify the codes in the source view.


It is quite annoying that I have to do this every time. I have tried a bunch of plugins from WLW and none of them works right for me. Until I found this ONE!

What you need to do is, copy the codes from Visual Studio and paste into the plugin box. And configure a few settings. It will make it right for you. Problem solved!!!! HOOYA.

It is version 1.3.0, please download from here

Version 1.3.0  (Recommended)
More Details
Download Now

Nuget commands to find packages and install them

I have been using Nuget in Visual Studio 2010, it is a time saver and make my life a lot easier.

To use Nuget, open visual studio 2010 => Tools => Library Package Manager => Package Manager Console.

So in the console, you can type your nuget shell commands to list available packages and install them to particular project.

To list packages,

PM> get-package –listavailable Elmah

You will get a list of available packages,


To install a package, (such as Elmah.MVC)

PM> install-package Elmah.MVC 

Nuget will install Elmah and its all dependencies. It also setup the settings in web.config

Isn’t that awesome!

For a full reference of Nuget shell commands, check out this link


MVC mini profiler, a simple effective profiler for mvc

Use Nuget to download mini profilder,

install-package miniprofiler

To use it, start the profiler in Global.asax, Application_BeginRequest()

protected void Application_BeginRequest()


    if (Request.IsLocal)





Write a condition to start the profiler, for Local Request, for special users, etc.

To use profiler for your code,

var profiler = MiniProfiler.Current; // it's ok if this is null

using (profiler.Step("Set page title"))
    for(int i=0;i<100;i++){

//do something



To display on the page, you need to include the profiler to _Layout.cshtml,


To end a profiler, end it in Global.asax, Application_EndRequest(),

protected void Application_EndRequest()




Glimpse, a server side “firebug” to see what’s going on in your server

Easy to setup and use, install the package from Nuget,

 PM> install-package glimpse 

It will install all the dependencies and modify web.config for you.

All you need to do is, go to http://yoursite/Glimpse.axd and turn it on.

Next time you make a request, glimpse icon will show at the bottom right corner of the page. And you can click it for more info.