Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Mitton 22 posts 71 karma points c-trib
    Jun 27, 2015 @ 07:40

    Views\Web.config namespaces not available in views in Visual Studio 2015 text editor

    I'm using Visual Studio 2015 RC (I know...)

    The namespaces specified in my Views\Web.config file are not coming into Intellisense.

    In web.config, I have the following:

        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Routing" />
            <add namespace="Umbraco.Web" />
            <add namespace="Umbraco.Core" />
            <add namespace="Umbraco.Core.Models" />
            <add namespace="Umbraco.Web.Mvc" />
            <add namespace="umbraco" />
            <add namespace="Examine" />

    But in the text editor, I'm unable to use the Html extension methods those namespaces provide.

    For example

    @{Html.Action("GetCompanies", "CompaniesSurface");}

    gives me red squiglies under Action, unless I manually include the namespace like this right in the view file:

    @using System.Web.Mvc.Html

    I'm also unable to use the @model syntax, so for my strongly typed partial views, instead of using:

    @model ModelClass

    I have to use:

    @inherits System.Web.Mvc.WebViewPage<LumaEE.Models.Company>

    This happened both with a project I created in VS 2013 and then opened in VS 2015 RC, and with a project I created from scratch in VS 2015 RC.

    I'm guessing it's a Visual Studio issue. Has anyone else seen this? What can I try to fix it?

  • Rasmus Eeg 91 posts 452 karma points c-trib
    Jun 27, 2015 @ 08:16
    Rasmus Eeg

    Hi Mitton,

    I suggest you take a look at this post.

    The reason is that VS2015 only supports MVC5 at the moment. Either upgrade umbraco to mvc5 or use VS2013 for intellisence.

    Upgrading umbraco to MVC 5 causes issues for some people so its not recommended.

    Best regards. R.

  • Peter Gregory 404 posts 1568 karma points MVP 3x admin c-trib
    Jul 23, 2015 @ 01:51
    Peter Gregory

    This issue still happens with the RTM as well. Upgrading to MVC5 is not really a good solution when it is not an option due to the age of the solution.

    For now I have moved back to vs2013 as I just cant see past the red squiggles.

  • Comment author was deleted

    Oct 26, 2015 @ 14:05

    Bump. Red squiggle hell here with VS2015, anyone get past it yet?

  • Comment author was deleted

    Oct 26, 2015 @ 14:08
  • gary 385 posts 915 karma points
    Oct 26, 2015 @ 16:12

    Hi Kevin

    Not seeing it now.

    Create doctype and template in Umbraco, then go to VS and right click the view file and include in project. Wait maybe 10 seconds and you will see the change.



  • Biagio Paruolo 1492 posts 1632 karma points c-trib
    Dec 10, 2015 @ 23:04
    Biagio Paruolo

    Don't work this workaround...I tried with a project with U7.3.3 ported from vs2013 to 2015

Please Sign in or register to post replies

Write your reply to: