T4MVC and Resharper Navigation

I often use the Resharper "Go to Declaration" keyboard shortcut (ctrl + b in the default cross-matching) to help navigate the VS2010. Before I included a link to T4MVC in my application, I would use "string references" and Resharper would know where I "meant" to go.

For instance:

@Html.Partial("_Continents" ) 

When I use ctrl + b on the "_Continents" , Resharper knew that I needed to go to the partial view named _Continents.cshtml.

Since I started using T4MVC, the same snippet above could be written:

 @Html.Partial( MVC.CascadingDropDownLists.DropDownAjaxPost.Views._Continents ) 

When I use ctrl + b on _Continents instead of taking me into a partial view, it leads me to the generated T4MVC code.

Is there a way to keep T4MVC in the project (I really like the strongly typed feeling and intellisense support) when restoring the original navigation?

+4
source share
2 answers

Unfortunately, ReSharper MVC navigation only works with constants. If T4MVC will generate consts instead of readonly fields - it should work.

+3
source

I created a small Visual Studio macro to help with this. It has problems, but it is much better than nothing IMO. It replaces F12, so you do not need to use a separate function for each.

I posted it here:

Visual Studio mask to go to T4MVC link

0
source

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


All Articles