Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-297091: Resharper indicates MVC Static Method Cannot be Found and also falsely indicates that the namespace can be removed

$
0
0
Reporter Greg Finzer (gfinzer) Greg Finzer (gfinzer)
Created Apr 23, 2012 6:17:19 PM
Updated Apr 23, 2012 6:17:19 PM
Priority Normal
Type Bug
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions 6.1.1
Fixed in build No Fixed in build
I have a using in a view that is required and Resharper says it can be removed:
@using SafeAuto.Mma.Web;

Resharper indicates the method cannot be found and it is in that namespace:
@{
ViewBag.Title = "List of Media Items for the " + Common.GetEnumDescription(Model.MediaLocation);
Layout = "~/Views/Shared/_Layout.cshtml";
}

Here is the static method in the static class Common:
public static string GetEnumDescription(Enum value)
{
    string result = string.Empty;
    if (value != null)
    {
        FieldInfo fi = value.GetType().GetField(value.ToString());
        DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);
        result = (attributes.Length > 0) ? attributes[0].Description : value.ToString();
    }
    return result;
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>