Question

I have an MVC2 application and use ReSharper 6.1 - I've heavily customised the Code Inspection Severity and edited what it decides to show as errors, warnings, suggestions and hints, but I cannot seem to stop it from telling me that a specific resource is missing when utilising a HTMLHelper.

So, for instance:

<img src="<%:Url.Content("~/Resources/Image12345.jpg")%>" />

I get an error on every line similar to the above telling me that the path above does not exist - which at design time it does not, but during the build process all of these views are XCOPY'd to a location which contains all of the resources, such as the images, so at the point of running the application all of this path resolution is correct. Because of working in a team of people, some of which are new to ReSharper, I wanted to exclude this error from appearing as it may cause colleagues of mine to start fiddling with something that isn't broken.

ReSharper obviously doesn't know that this isn't an issue and it has no way of knowing which is why I want to turn off this specific bit of analysis. I've found on the whole that ReSharper is massively customizable and in version 6.1 under Inspection Severity there are some new MVC options, which have proved useful - but I can see no way of turning off the inspection for this.

Anybody have any ideas?

Was it helpful?

Solution 3

Well - It seems that this particular type of inspection is not currently catered for. I'll see if I can request it with JetBrains and hopefully more granular MVC inspection will be included in the future.

Cheers guys

OTHER TIPS

There are few options, press ALT+ENTER.

  1. Suppress inspection "Path Error" with comment. You can suppress whole block of code, not only each of tag.
  2. Suppress inspection "Path Error" at all at whole project.
  3. There is new feature of 6.1 - path mapping, but it seems broken in conjunction with MVC.

Set to ignore that specific error by:
Open Soultion Errors Window by ReSharper->Windows->Soultion Errors Window. Right-click annoying error and select Ignore Error.

See answer for another error for more explanation.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top