ASP.NET Core 2 - ReSharper's Create Razor View adds a new view to the Pages folder

I started testing the new ASP.NET Core 2 to create an MVC web application and it looks good so far ...

In addition, when I create Views from my actions with the controller, ReSharper creates them in the Pages folder, and not in the Views folder (where I generally like to save my Views ;-))

resharper create razor view view in folder folder

ReSharper does not behave this way for regular ASP.NET web applications (not for the kernel), it puts the views in the correct view folder, so it seems to work with Core / Core 2.

What is used by resharper to decide where to create a view?

How can I change this behavior to create views in a traditional layout?

+4
1

, Resharper, , Razor Pages Apps.net core 2 team .

, , Reshaper.

. , , JetBrains - :) - .

  • nuget Jetbrains.

    Install-Package JetBrains.Annotations
    
  • .cs asp.net - ResharperConfig.cs - :

    using JetBrains.Annotations;
    
    [assembly: AspMvcMasterLocationFormat("~/Views/{1}/{0}.cshtml")]
    [assembly: AspMvcViewLocationFormat("~/Views/{1}/{0}.cshtml")]
    [assembly: AspMvcPartialViewLocationFormat("~/Views/Shared/{0}.cshtml")]
    [assembly: AspMvcAreaMasterLocationFormat("~/Areas/{2}/Views/{1}/{0}.cshtml")]
    [assembly: AspMvcAreaViewLocationFormat("~/Areas/{2}/Views/{1}/{0}.cshtml")]
    [assembly: AspMvcAreaPartialViewLocationFormat("~/Areas/{2}/Views/Shared/{0}.cshtml")]
    
  • VS. ( ).

  • , R # . , .

Resharper issue

, !

+5

Source: https://habr.com/ru/post/1686502/


All Articles