[2150] Cannot disable access error for Url.Content path not found

Url.Content("~/docs/ex.csv")

When a Controller has Url.Content with a location that Resharper doesn't think exists it will error the line. However clicking the red tick mark to move to the error leaves you with only the string options of "add a new format item and proper argument" and "split string"

There is no way to access the error itself.

9 comments

Thread should read:[2150] Cannot access error for Url.Content path not found

0

Hello Chris,

Could you please attach a screenshot of the list of available context actions
in this case? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Url.Content("~/docs/ex.csv")

When a Controller has Url.Content with a location that Resharper
doesn't think exists it will error the line. However clicking the red
tick mark to move to the error leaves you with only the string options
of "add a new format item and proper argument" and "split string"

There is no way to access the error itself.

---
Original message URL:
http://devnet.jetbrains.net/message/5302891#5302891



0

This issue is still present on the latest versions of R#.

resharperpath.png

These incorrect errors are infuriating, there is no way to stop this. I can't disable this error anywhere, every single instance of an error that includes "path" from the search box in inspection options is set to warning or lower. I can go through and tell it to ignore the error from the code inspection window but that only lasts until i close and reopen the solution.

0

This is what it took to shut resharper up on this:

    public static class UrlHelperExtensions
    {
        /// <summary>
        /// This is to stop the R# insanity of it complaining the url doesn't exist
        /// </summary>
        /// <param name="helper">The helper.</param>
        /// <param name="url">The URL.</param>
        /// <returns></returns>
        public static string For(this UrlHelper helper, string url)
        {
            return helper.Content(url);
        }
    }

0

Chris, do the files really exists in file system/solution?
Here, for example, ~/docs/ex.csv?

0

do the files really exists in file system/solution? : No.

Are they valid routes according to the routing configuration? Yes.

0

On 26.03.2012 3:14, Chris Marisic wrote:

do the files really exists in file system/solution? : No.
Are they valid routes according to the routing configuration? Yes.


Chris, we are aware about MVC routing recognizing (and it's planned for 7.0 release
http://youtrack.jetbrains.com/issue/RSRP-225684)
Also, you can use workaround, like Url.Action extension method, with explicitly specified action and controller, instead
of just path (it's even better, because you can change your routing without changing all references to it).
And last, but not least, we can do something to allow suppress such errors by comments in near EAP builds.

0

In our scenario, usage of Url.Action is actually a deteriment. The core expectations Url.Action makes in regards to routing with MVC do not along well to a restful architecture. We use the open source projects RestMVC and restfulie to have a routing system that allows us to describe the resources we actually are representing as opposed to routes that represent controller names and action method names.

0

Please sign in to leave a comment.