Aug 10, 2011 at 2:02 PM
Edited Aug 10, 2011 at 2:30 PM
I understand, and after developing a workaround which gets Razor IntelliSense working for other namespaces, I humbly retract my earlier email.
In order to get IntelliSense working, I had to do the following.
1. I created a new ASP.NET MVC 3 Web Application project (Project 2), and added the NuGet packages for the PreCompiledViewEngine and MvcMiniProfiler.
2. I ran the new website. This apparently triggers Razor IntelliSense to accept other namespaces, such as MvcMiniProfiler (though there is a whole discussion about why this must be in itself).
3. I removed the Contents, Controllers, Models and Scripts folders from Project 2, so it is essentially a precompiled view library.
4. I added Project 2 to my solution containing an MVC 3 Web Application (Project 1), and added a reference in Project 1 to Project 2, so that Project 1 will use the precompiled views built in Project 2.
This gave me a project with full Razor IntelliSense, which I now can use as a precompiled view library.
P.S. To add any HtmlHelpers to Razor IntelliSense, you must add the namespace for your helpers to the namespaces collection in the web.config file in the Views folder (and in any Areas), then you must unload and reload your precompiled view library