"Cannot resolve view XXX" -- separate project
Our solution is set up so that the controller classes are in a separate class library that is reference by the web project. All of the views are in the web project.
ReSharper is generating the "Cannot resolve view XXX" error every where we return a ViewResult, presumably because it's not aware of where my views are.
How can I either (a) teach ReSharper where my views are or (b) turn off this error (but I still want other asp.net errors)?
Regardsm
Brian.
Please sign in to leave a comment.
Hi Brian!
Can you provide example of layout of your projects, views folders, controller classes in you solution?
Because we support views in different projects in solution if they have references to controllers' project.
I'll see what I can do. I'll start with an ASCII picture. It'd take me a bit to come up with a clean-room example to attach.
My Solution
|__My.Web.UI
| |__Public
| | |__Home.aspx
| |__Private
| |__Account
| |__Summary.aspx
|__My.Web.Controlls
|__Private
|__AccountController // Index() returns View("Summary")
Where AccountController's Index() action method returns a ViewResult for the "Summary" page, ReSharper is highlighting it as an error saying Cannot resolve view "Summary".
My.Web.UI references My.Web.Controllers, but the reverse is NOT true. That is what is required, correct?
If I understand correctly, and its not working, then I can work on producing a clean-room project to send in.
Regards,
Brian.
Brian Sayatovic wrote:
Yep, exactly.
That would be helpful. Do you use MVC areas somewhere in project?