Why remove unused references




















Remove Unused References. Clean Code With Default Profile. Default Code Cleaner Steps. Quick Fixes. Quick Hints. Unit Testing. Keyboard Shortcuts Profiles. Cloud Sync. Having the impression that you asked about removing unused references DLLs and all the answers are about removing unused using statements.

Clay Shannon. Aight, correcting the wording to fit the meaning. Add a comment. Active Oldest Votes. There aren't any performance benefits, if that's what you mean. Improve this answer. Robert Harvey Robert Harvey k 54 54 gold badges silver badges bronze badges.

There can be an indirect benefit to removing unused Usings. The generated IL doesn't change if you remove usings, so I don't see how anything would be affected. I had in mind: Remove unused using s from a Web Application Project. Those had been the only lines of code compelling inclusion of a bunch of DLL references, so now remove those. Shorter code is more readable code. Yes - I can think of two primary benefits: Beyond its primary functional purpose i.

If you actively prune this list, it can act as a better signaling mechanism. Removing unused namespaces will reduce the number of autocompletion candidates in your text editor as you type. If you rely on the autocompletion lists at all, this will help keep you "on the straight and narrow" and may even increase your typing speed, as you should be able to find your intended autocompletion candidate just a little bit faster.

Jim G. Ah, very good points, especially 2! Removing unused code, is just extra baggage and hard to measure the efficiencies gained. But there is the way to make it work in VS as well ;. I've tested it with VS, thanks source for the tutorial. You can use Reference Assistant extension from the Visual Studio extension gallery. This feature will be coming to Visual Studio very soon and already available with Visual Studio v Once the option is enabled, the Remove Unused References command will appear in the right-click menu of a project name or dependencies node.

Then click on the Recent tab where you can see list of references used recently. Locate the one you do not want and delet it. Then you close without adding anything. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Removing all unused references from a project in Visual Studio projects Ask Question. Asked 11 years, 4 months ago.

Active 5 months ago. Viewed k times. In your answer, please specify which version of VS the solution applies to. Improve this question. KroaX KroaX 5, 4 4 gold badges 26 26 silver badges 41 41 bronze badges.

Generally wondering, Does removing these DLLs result in observable improvement in build time or something else? Of course, other than removing redundant dependencies — monish Net project have it since VS , but it was never implemented for C projects msdn.

You can vote to have this feature included as part of VS as it should be. Show 2 more comments. Active Oldest Votes. Improve this answer. Ed Greaves 4, 2 2 gold badges 20 20 silver badges 19 19 bronze badges.

Ernest Ernest 1, 13 13 silver badges 22 22 bronze badges. Your last statement "However it's not perfect, any assemblies which are dependent on referenced assemblies in your current project are still marked as unused.

The build knows to copy the references of your references. See this answer: stackoverflow. While this is a viable way to do this the "within various Visual Studio versions" to me means not something else but already "within" — Mark Schultheiss. Add a comment.

This extension supports Visual Studio through Nick N. Mathieson Mathieson 1, 1 1 gold badge 13 13 silver badges 18 18 bronze badges. So i do not trust Resharper with references — Offler. Pete, any automated tool will have the possibility of overreaching.

Especially in the age of DI and PCL dependencies which appear to be ununsed might be needed, but that's hardly the fault of the tool. Rather than doing a screenshot, you should be using version control software.

A modern system like Git or Hg will let you checkin frequently locally, so you don't ever lose work. I'd like to find the latter as well — Sonic Soul.

Show 4 more comments. David Bond 7 7 bronze badges. Wacky Wacky 5 5 silver badges 4 4 bronze badges. Not working with MVC project. It remove essential DLL as. Helpers and. WebPage — User. Amit the extension has a working version for VS now — Philipp M. That works if you follow a simple trick: devio. All you need is stone and bare knuckle then you can do it like a caveman.

Throw your stone You can also rely on your build tools to let you know which reference is still required.



0コメント

  • 1000 / 1000