R# “cannot resolve view” when changing the default location for views + custom ViewEngine for ASP.net MVC2
We have a project in ASP.net MVC2 were we have our own ViewEngine that overrides were views locations are and a few other things. Problem is that Resharper 5.1 is not picking up this, as expected. Is there anyone who knows of a way to extend R# to pick this up?
I don't want to disable R# to not try to resolve view globally or local with the R# comment. I want to full tooling support.
Please sign in to leave a comment.
Sorry, but ReSharper supports only default layout.
No plans, currently, to extend this support to custom layouts.
Thats too bad.
Do you know if the Spark engine has a solution for this?
It just feels very wrong to not get tooling support if one decides to not go with the Microsoft convention.
I agree with Einar. This bug causes us lots of false positives when using R# to check for solution errors.
I don't see why R# couldn't look for the view locations specified in ViewEngines added to the application. This functionality would be very helpful. I hope you change your mind about adding this support :)
Or even just make the view locations configurable per project in any way without it having to scan the code for it. I'd be happy to set that setting once.
I'd second that. Was quite surprised that this is not supported as it is hardly an edge case. I cannot imagine many projects can keep things managed with just the default locations.
It seems a strange stance that they would not support it, would see this as a bug within R#. At least I'd put my vote if it were a feature request.
Long time user.
I have to agree with everyone else. This is going to be a required feature. If ReSharper gives us lots of false positives, then we lose a lot of benefit of using it. If I manually have to filter out these kind of errors, it's going to create friction. Removing friction is exactly what we use ReSharper for!
+1 vote as a feature.
Please reconsider, and fix this "cannot resolve view" bug (or add a new feature), at least for ReSharper 6, this is annoying us here as well.
Thanks,
Tormod
+1
+1
I would second the reconsideration of this request as most of the web apps I work on with MVC and R# are using custom view engines and I'd like to use solution analysis more often.
Paul Shannon
Fo not supported, custom ViewEngines, you can always diable ASP.NET MVC analysis, and use rest solution anadlyses without problems.
Thanks for your feedback.
There's a feature request at http://youtrack.jetbrains.net/issue/RSRP-190961 and you're welcome to vote for it. While we can't commit to implementing it very soon, we'd like to know how many users want this functionality
Hello,
That ticket (RSRP-190961: Support non-default ASP.NET MVC folder locations) is marked as fixed in 6.0. We're running 6.0 Full Edition (6.0.2202.688) with views in their own assembly separate from the web project; how do we configure ReSharper to recognize the custom view locations?
Jesse
On 30.06.2011 20:24, Jesse Plamondon-Willard wrote:
Do you alter default view location by assigning of VirtualPathProviderViewEngine.ViewLocationFormats property?
Is it done in the same solution?
Yes, we override the view engines with a configured
like this:
, which are copied to in the project by an MSBuild task before compilation. This allows us to enforce segregation during development without reflecting on a compiled assembly at runtime. Unfortunately, this means the files are not part of the project before compilation, so they're not available to ReSharper at the location known to the .We have our views in
Can ReSharper be configured to look for the views in the assembly?
Currently, ReSharper can detect altering of default view locations only by direct assigning of ViewLocationFormats/ViewLocationFormats. So, if you inline your RegisterViewEngine method it may help.
Unfortunately, that had no effect.
project file — is copied from the project into just before compilation by an MSBuild task. The files exist at the location, but they're not included in the project file. For example, ReSharper also flags a full path:The cause may be that the views are not included in the
We merged
back into for now, until we have time to reexamine that approach.Thanks for the help, much appreciated.