Visual Studio T4 Templates

Templates Designed using the Text Template Transformation Toolkit

BEST: and :



Follow these in order:

1. Install the Free Tangible T4 extension in VS…







Cool Enhancements in VS 2012 Update 2

paste json as classes in vs 2012 :

then in JS file use the Model Binding to get intellisense on the JSON that will be returned at runtime using binding…


1. JSON IS :

"link": "", /*Awesome*/
"virtual": "Virtual Keyboard",
"partial": " The magnesium panels are finished with partial vapor deposition",
"Price": 499.99,
"title": "Microsoft Surface",
"शीर्षक": "माइक्रोसॉफ्ट सरफेस",
"Like": true,

2. On pasting

namespace MvcApplication6.Models
public class Rootobject
public string link { get; set; }
public string _virtual { get; set; }
public string partial { get; set; }
public float Price { get; set; }
public string title { get; set; }
public string शीर्षक { get; set; }
public bool Like { get; set; }
public object cdDrive { get; set; }

3. Then in js file:
function doit(data) {
    /// <param name=”data” value=”MvcApplication6.Models.Rootobject”></param>  
    var foo = data.titl_virtual

this thing (pt no 3) is not yet finalized in VS …

Javascript intellisence enhanced using Nuget Packages

I remember having written about the jquery vsdoc that can  be downloaded form somewhere….blah blah…
But now its available as a nuget package so better use that as apart from the time saved in copy pasting, nuget allows for auto updation of packages also …

In Visual Studio 2012, Visual Studio will automatically find “.intellisense.js” file and use it like old vsdoc file without writing real JavaScript structure.


OK, so i created a empty website and in that included the VS 2012 Javascript intellisense package first..

Then i wanted to compare the JQuery packages so i installed the most popular one first and it came with a .intellisense.js file but it wasn’t this good (, so then i excluded that and added the “jquery vsdoc” from nuget which was much better….

NOTE: Use both Ctrl + space and Ctrl + Shift + Space

THIS IS OFFICIAL: Resharper Ruins JS Intellisense in VS 2012. once i disabled it, i got intellisense like : (


Finally Found the Best of Both Worlds in INTELLLISENSE…

So basically do  : ensure that Tools | Options -> Text Editor | JavaScript | General -> Auto list members  and Paramater Information is turned on.

I got the VS Intellisense and also Resharper too….
And in case u don’t like Resharper’s then press Esc to see the VS one behind it…
If u want pure VS only then on top of above, do :
If you prefer Visual Studio intellisense, please go to ReSharper | Options -> Environment | Intellisense | General, select Limited ReSharper intellisense and turn off JavaScript there.
In fact in Tools Options Editor All Lang make sure these are ENABLED :
1. Auto list members
2. Paramater Information
3. Word Wrap
4. Visual Glyphs
5. Line Nos

Shortcut Sharing Between Visual Studio and Resharper and Everyone Else

Having Infinite extensions installed is always a risk wrt shortcuts overriding each other and exploding your brain..

Resharper has removed the bindings to my 2 fav VS Commands :
Ctrl Q for Quick Launch and Ctrl E to search while adding a new file in project. Hence i went to tools options keyboard

Fixing this was surprisingly easy :

Suppose you want to change the binding of “Ctrl +Q”

1. Open Tools Options Environment Keyboard

2. Under “Press Shortcut Keys” Enter : Ctrl +Q

3. This will show you what all commands are currently bound to this shortcut

4. Then search for the commands in the “Show Commands containg window ” and REMOVE the asignment (for the context that you want).

5. Note that more than 1 command can bind to a shortcut depending on the context and so make sure you remove whatever you need

6. Then verify that no the binding is gone, by repeating step 2 above

7. Finally search for the new command that u want to bind the shortcut to and then enter shortcut and bind it in the context that u want to using ASSIGN


Remove Javascript intellisense from Visual Studio 2012

ha, how ironical…

Well the thing is that now that i use NuGet, it downloads 10s of JS files for no reason (i mean i need only 1 but it downloads all js files of the framework).

Then in the _references.js it adds ref to all these and as i have set in Tools-> Options -> JS-> intelli
that i want intell from files listed in _ref.js and in the C:\Program Files (x86)\Microsoft Visual Studio 11.0\javaScript\references folder (i think this is default setting)
so it throws all that on my face…

Hence remove everything from both these locations which u don’t want intellisence for

Even after removing js files from all these places intellisense was still perest hence i excluded the js files from project and then it was gone..then this is the source but where is the ref. ??

Then i searched for “jquery” in the entire project and found that its referenced in the auto generated classes like packages.config and BundleConfig.cs and then in Index.cshtml it is referenced as : @if (@User.Identity.IsAuthenticated)
    @section scripts {

and also in Layout.cshtml :


All this may be causing VS to give intellisense and it goes away only when these files are explicitly removed from the project….

whooo….this is fact the entire MVC 4 template is bad as it scaffolds so much stuff that its hard to maintain any control over stuff…..

found out that In Visual Studio 2012, Visual Studio will automatically find “.intellisense.js” file and use it like old vsdoc file without writing real JavaScript structure…and as the MVC Project scaffolding comes with the jquery.intellisense.js files etc. this may be the real reason for auto intellisense when i was simply includinf the files in the project….