Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ReSharper isn't able to resolve Razor

I have an ASP.NET MVC 3 Solution within Visual Studio 2010 Premium with Service Pack 1.

In the Web.Config my ReSharper Version (Build 5.1.3000.12) isn't able to resolve System.Web.WebPages.Razor.*

For example

<sectionGroup name="system.web.webPages.razor"
    type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup,
    System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=31BF3856AD364E35">

lets ReSharper mark the error Cannot resolve symbol 'Razor' and error Invalid module qualification: Failed to resolve assembly System.Web.WebPages.Razor

But all views (*.cshtml) are working fine and ReSharper doesn't mark errors there. Also under References I included System.Web.Razor. This errors also appeared with Visual Studio Premium without Service Pack 1. I'm getting this errors even if I create a new MVC 3 Project out of Visual Studio.

Thanks in advance for any help.

like image 538
hoffman Avatar asked Mar 31 '11 13:03

hoffman


2 Answers

Resharper 5.1 doesn't support Razor, 6.0 will. You can download and use the nightly builds if you like, but they can be somewhat unstable. Use at your own risk.

like image 56
Erik Funkenbusch Avatar answered Sep 28 '22 11:09

Erik Funkenbusch


As others have cited, this is a feature not a bug ;-)

If you would like to avoid annoyance with these errors, you may right click "web.config" in the "Errors in Solution" window (ReSharper -> Windows -> Solution Errors Window) and choose "Ignore Errors." Then they won't bug you any more.

Another plug for the ReSharper EAP program, I used it with 5.0+ and found it to be a reasonable way to get the latest and greatest. As others have said, your stability mileage may vary as these are nightly builds.

http://confluence.jetbrains.net/display/ReSharper/ReSharper+6.0+Nightly+Builds

like image 33
Mark A Avatar answered Sep 28 '22 11:09

Mark A