Copied to clipboard

Flag this post as spam?

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


  • Dan Evans 629 posts 1016 karma points
    Jul 29, 2015 @ 16:55
    Dan Evans
    0

    Intellisense in VS 2015

    I have just moved a 7.2.5 project from VS 2012 to VS 2015 but am getting the following Intellisense errors. I have upgraded MVC to 4.0.0.1 and added in a binding redirect. This produces a warning under references to Umbraco, var, String - pretty much everything.

    Severity Code Description Project File Line Warning CS1702 Assuming assembly reference 'System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' used by 'umbraco' matches identity 'System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' of 'System.Web.Mvc', you may need to supply runtime policy rbl2015

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Jul 30, 2015 @ 08:50
    Sebastiaan Janssen
    4

    It took me a while to realize and, to be honest, I ignored the upgrade report when opening Umbraco projects in VS15. They clearly state:

    ASP.NET MVC 4 projects have limited functionality in Visual Studio Next. Commands such as Add Controller, Add View, Add Area, and Go to View/Controller are not available. Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup.

    However, there is a bug in Umbraco currently, if you have a macro that contains a SurfaceController and in the SurfaceController you do ModelState.AddModelError("SomeField", "Some message"); then it will fail. This is fixed in 7.3.0.

    I'm about to write a blog post on how to upgrade an Umbraco project to MVC5. If you use NuGet then it should be as "easy" as:

    Uninstall-Package Microsoft.AspNet.WebPages.Administration
    Uninstall-Package Microsoft-Web-Helpers
    

    these may fail if you don't have these packages installed, so ignore errors from that

    Uninstall-Package Microsoft.AspNet.Mvc.FixedDisplayModes -Force
    

    don't forget the -Force

    Update-Package Microsoft.AspNet.Mvc
    Install-Package ClientDependency-Mvc5
    Update-Package Microsoft.AspNet.WebApi
    

    You might also need to install WebHelpers if you currently have it installed:

    Install-Package Microsoft.AspNet.WebHelpers
    

    Which then most likely also requires:

    Install-Package Microsoft.AspNet.WebPages.Data
    

    Lastly, you will need to go to Views\web.config and replace all instances of 2.0.0.0 with 3.0.0.0 and all instances of 4.0.0.0 with 5.2.3.0.

    Yeah "easy", right? ;-)

    It's a bit shitty but Microsoft in their infinite wisdom decided that they don't support MVC4 any more in VS15 so either use VS13 or upgrade to MVC5 if you want the squiggles to go away (intellisense still works but everything is marked as being "wrong").

  • Dan Evans 629 posts 1016 karma points
    Jul 31, 2015 @ 08:49
    Dan Evans
    0

    Thanks Sebastiaan, that works! No more squiggles!

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jul 31, 2015 @ 14:35
    Søren Kottal
    0

    Is it not possible to add MVC4 support?

    I have a bunch of old projects, that I don't really want to upgrade to MVC5.

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Jul 31, 2015 @ 15:08
    Sebastiaan Janssen
    0

    @Søren It's simply not supported by MS:

    ASP.NET MVC 4 projects have limited functionality in Visual Studio Next. Commands such as Add Controller, Add View, Add Area, and Go to View/Controller are not available. Intellisense for Razor (CSHTML and VBHTML) files is limited to HTML markup.

  • Comment author was deleted

    Oct 26, 2015 @ 14:12
  • Comment author was deleted

    Oct 26, 2015 @ 20:05

    @Seb, thanks for putting this all together. FWIW though it's not working for me. Still getting red squigglies but it's likely something I didn't do properly.

    I'll try again another time :)

  • ibrahim TUNC 54 posts 132 karma points
    Feb 11, 2019 @ 13:25
    ibrahim TUNC
    0

    After installation of Umraco with MVC selection

    1- If the following lines of code give a warning:        Assuming assembly reference 'system.web.mvc version = 5.2.3.0 culture = neutral, publickeytoken = version = 5.2.4.0

       Requirements:

       If the Microsoft.AspNet.Mvc package is version 5.2.4 or higher    Remove the installed package from the Nuget Package Manager by selecting the dependency options,    Then, installing Install.Package Microsoft.AspNet.Mvc -Version 5.2.3 will eliminate the problem.

    2- After doing this step, you will need to Clean Solution and then Build it. 3- In the build process, it can give an error message as follows.

       Analyzer 'Microsoft.CodeAnalysis.CSharp.Analyzers.FixAnalyzers.CSharpFixerWithFixAllAnalyzer' threw an exception of type    Solution from Console    From the following URL    https://www.nuget.org/packages/microsoft.codeanalysis.analyzers

       Microsoft.CodeAnalysis.Analyzers 2.6.3 The Nuget Package will be installed to correct the corresponding error.

       Then you will need to Clean the project and then Clean again.

    That's all

Please Sign in or register to post replies

Write your reply to:

Draft