razor intellisense not working on VS2010 for microsoft.web.helpers

I have VS2010 Premium,.NET4.0, MVC3 Tools Update.

I've nugetted microsoft-web-helpers successfully.

I cannot get @razor intellisense to recognize the microsoft.web.helpers classes.

They do work correctely at runtime, i.e. @Twitter.profile shows a profile, but at design time the statent is seen as an error and no members are shown after "."

I've tried to add

<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

to the

  <assemblies>

element in web.config, but it didn't help.

Any idea? thanks.

Answers


Try adding the following in the web.config of the Views folder under the following section. After editing this, restart Visual Studio.

  <system.web.webPages.razor>
    <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <pages pageBaseType="System.Web.Mvc.WebViewPage">
      <namespaces>
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.Helpers"/> <!--This is the new entry-->
      </namespaces>
    </pages>
  </system.web.webPages.razor>

I had the same problem and solved it by selecting the "Use Visual Studio Development Server" on the project Properties page.


Need Your Help

How to add a node to XML with XMLBeans XmlObject

java xml xmlbeans

My goal is to take an XML string and parse it with XMLBeans XmlObject and add a few child nodes.

Check size of sun.misc.Queue

java queue

My project is using a Queue by extending sun.misc.Queue and I need to know size of this queue every second.