If you have custom types and custom ASP.NET MVC Helpers, and if you set your Visual Studio Web Project’s Build Output Path folder to something other than the default “bin\” location, then you will be in for a little surprise – you will not see your custom types in the Razor Intelllisense!
It appears that Razor’s Intellisense uses the assembly binding probing path of your Web Project’s root folder and the “bin” sub-folder.
If your Build Output Path is a sub-folder of your Web Project application base folder / root folder (although I don’t understand why you would bother) you could make a change to the web.config file and add a probing privatePath configuration such as:
<configuration>
<runtime>
<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<probing privatePath=”myBin” />
</assemblyBinding>
</runtime>
<configuration>
However, in the more likely scenario that you have a common central location for all of your assemblies that is outside of your Web Project application base folder / root folder, then unfortunately by design (for security and side-by-side execution) there is no configuration setting in .NET that is going to help. You cannot load assemblies from outside of your application base folder (via configuration in .NET) – unless they are strong named and in the GAC.
In my scenario, the Build Output Path is outside of the Web Project’s root folder, so configuration is not an option, and my assemblies are not strong named, so the GAC is not an option.
One solution is to create a Visual Studio 2010 Extension or post-build script that copies all the assemblies from my custom Build Output Path into the local “bin” sub-folder. That would work, although it would also slow down my build times and frankly isn’t elegant.
A better solution is to take advantage of the fact that in my scenario the “bin” sub-folder does not actually exist in my Web Projects. I can make it exist in Windows 7 by creating a symbolic link named “bin” which points to my Build Output Path – and then magically Razor Intellisense works!
Note that when you create a symbolic link you need to have Administrator privileges.
The syntax to create the symbolic link is:
mklink /d x:\MyWebProject\bin y:\MyCommonAssembly\Bin


Hi Adam, I am trying to run MVC3 by using it’s source code and am having the problem described here of no Intellisense.
Basically, it’s just the solution with MVC3 source fresh from CodePlex, plus a web project referencing it (and the commensurate changes to both web.configs). All the assemblies are in the web’s bin folder, but Intellisense for the HTML helpers etc. etc. is all broken.
Do you have any idea how I might troubleshoot such a thing? Think there is any chance of getting Intellisense back?
Hi,
The first thing I would do is disable as many Visual Studio extensions and refactoring tools as possible – to rule out their influence. Refactoring tools like Resharper and CodeRush can modify the way that intellisense works…
I am not sure if you having trouble with absolutely no intellisense whatsoever working, or just the Razor HTML helper intellisense not working.
Either way, troubleshooting these problems unfortunately is really a matter of trial and error, and blood, sweat and tears!
My sugguestion with these types of things is: Go back to basics!
1. Start from scratch in a brand new out of the box, standard web MVC3 project.
2. Determine if intellisense works
3. If not, then you have some sort of configuration/installation problem.
4. Otherwise, step by step, morph the configuration of the project into what you have now, and after each step, close and reopen the solution, and do a test to see whether intellisense works.
The reopening of the solution / project is important, otherwise Visual Studio may have cached configuration and/or intellisense settings.
Come to think of it, if memory serves, you might be able to get away with just closing and reopening the file that you are editing.
[I learned that tip the hard way after _many_ hours of frustration and differing results!]
Also, please ensure that you have the minimal settings as I outline in my other related post: http://adammcraventech.wordpress.com/2011/05/04/minimal-configuration-required-for-razor-intellisense-in-asp-net-mvc-3-rtm/
Good luck, and let me know how you go!