Visual Studio 2010 - IDE command to find extension method namespace?
I make heavy use of + <.> to find the namespace of types and have VS.NET import those types into my class files. Similar to that, suppose I have a DateTime extension method called ToWebsiteString()
. I'd like to be able to type myDateTime.ToWebsiteString
, and then hit the equivalent of + <.> and have the IDE display a list of all available namespaces with that extension method, so that I can simply select the namespace and have VS.NET import it into the class file that I'm working in. Does that already exist?
If not, what is the most productive way you've found to import your extension method namespaces?
Edit: Are there any free solutions for this?
Edit: Other than the pay for Resharper, it doesn't appear that there are any free solutions for this, so I'开发者_运维百科ve closed this question.
Thanks
Resharper can do this for you.
Type myDateTime.ToWebsiteString
, hit Alt+Enter
and Resharper will show a list of namespaces to select from.
If you type/select the extension method, like:
Html.ActionLink
Then hit F12 with the cursor inside the extension method name, Visual Studio will take you to the class (and namespace) that adds that Extension Method, even if it's buried in some DLL somewhere (it shows you the public method stubs). Good enough, works without Resharper.
精彩评论