Project
ReSharper
Priority
Show-stopper
Type
Feature
Fix versions
6.1
State
Fixed
Assignee
Kirill Skrygan
Subsystem
No subsystem
Affected versions
No Affected versions
Fixed in build
6.1.0.5287  
  • Created by   Andrew Serebryansky
    5 years ago (05 Aug 2006 02:47)
  • Updated by   Serge Baltic
    7 months ago (25 Oct 2011 22:14)
  • Jira: RSRP-6312
    (history, comments)
 
RSRP-6312 Optimize project references
43
Issue is visible to: All Users
  The issue is visible to the selected user group only
Remove redundant references from a project if none of the types in the referenced asseblies are used
Comments (11)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Ryan Hendrickson
  Ryan Hendrickson
25 Nov 2009 23:54
2 years ago
I've seen a bunch of feature requests around this general theme; this seems to be the oldest/most focused, although the description is a little unclear.

What I'd really like is a context menu item on the project's References folder for "Remove unused references".

See also:
http://jetbrains.net/jira/browse/RSRP-3898
http://jetbrains.net/jira/browse/RSRP-24775
http://jetbrains.net/jira/browse/RSRP-33587
http://jetbrains.net/jira/browse/RSRP-48171
http://jetbrains.net/jira/browse/RSRP-56678
Andy Skalkin
  Andy Skalkin
26 Nov 2009 02:50
2 years ago
Yeap, the same context menu should exist for the whole solution as well.
Andy Skalkin
  Andy Skalkin
26 Nov 2009 02:52
2 years ago
Drew Noakes
  Drew Noakes
26 Nov 2009 14:06
2 years ago
It would be cool to have a visual indication of the redundant reference in the solution explorer tree view. Perhaps the text is in faded grey, or it is underlined with a green squiggly line. As the 'References' node is often collapsed, it'd be nice to have this status carried up to the parent so that it was easy to spot at a glance of the project.
Alexander Mezhov
  Alexander Mezhov
20 Jan 2011 19:08
16 months ago
I would like this feature. Please, do it in next release! ;)
brent dearth
  brent dearth
04 May 2011 19:38
12 months ago
Would be incredibly useful for project maintenance. Bump!
Steven Evans
  Steven Evans
14 Jun 2011 19:19
11 months ago
I would find this verry usefull.
Kirill Skrygan
  Kirill Skrygan
16 Sep 2011 19:58
8 months ago
Three features were implemented:
  • Optimize references: to see all external usages regarding specific referenced assembly, to remove all unused referenced assemblies.
  • Remove unused reference refactoring: to quickly check and remove unused references (without dispalying usages).
  • Safe delete on assemlby reference: to quick delete assembly reference and be sure that this will not affect your compilation. Otherwise you will see affected usages.

These features were implemented for C#, VB and XAML.

Note: if there were some redunandt namesapace imports which makes you reference unused assemblies, then both the assembly reference and corresponding redundant namespace imports will be removed.
Drew Noakes
  Drew Noakes
16 Sep 2011 22:53
8 months ago
Great news, thanks.
Damian Hickey
  Damian Hickey
25 Oct 2011 22:11
7 months ago
There are some cases where a reference has an 'indirect' dependency on another assembly which is loaded at runtime (possibly by reflection). If this other assembly is not in the bin directory, one will get a runtime error. The result is this 'other' assembly is often referenced just to be copied but it's not actually used by the project's code and so would be marked as a redundant reference.

An example would be Raven.Client.Embedded that loads Raven.Storage.Managed at runtime.

So to support this, I suggest being able to add an ignore file to the project, perhaps in a similar way one can add GlobalSuppressions.cs for Code Analysis.
Serge Baltic
  Serge Baltic
25 Oct 2011 22:14
7 months ago
You could write such an ignore file right away. Add some code which references any public type from the assembly to be kept in references.