MVC4 display modes view resolution problems

Hi,

We use Displaymode feature of MVC4 to implement multitenancy for views in our MVC application. It works as following - a list of displaymodes is generated on app startup e.g for 2 tenants:

0. suffix = "tenant1.mobile", name = "tenant1mobile"
1. suffix = "tenant2.mobile", name = "tenant2mobile"
2. suffix = "tenant1", name = "tenant1"
3. suffix = "tenant2", name = "tenant2"
4. suffix = "mobile", name = "mobile"
5. suffix = "", name = ""

Corresponding views will then have following extensions:

Index.tenant1.mobile.cshtml
Index.tenant1.cshtml
Index.tenant2.cshtml

In this case there is no reason to have separate "Index.cshtml" created since all tenants have their respective overloads.

Unfortunately resharper struggles to resolve "Index" view in this case and I can only guess why:
1. is it because it does not support suffixes with "." inside?
2. is it because full list of display modes is generated on app startup and resharper supports only declarative lists?
3. any other reason

Could you please elaborate on how the View resolution works in resharper in context of R# 7 feature of supporting display modes in MVC4?

P.S. We use MVC4 on .net 4.0 in VS2010; R# is 7.1.21.26

Best Regards,
Sergii

2 comments
Comment actions Permalink

Just doublechecked - still an issue in R# 8 eap.

Could you please post suggestions of how to overcome this problem, or should I file a bug?

Is there any way to help resharper with view resolution?

Best Regards,
Sergii

0
Comment actions Permalink

Hello Sergei,

The best way to solve this issue is to fill in a bug-report in YouTrack here: http://youtrack.jetbrains.com/issues/RSRP
Please make sure that you'll attach a repro case there, as well as post an issue link here so I could update ticket fields and assign it to the corresponding developer.

Thank you in advacne for that!

0

Please sign in to leave a comment.