Is there a way I can have Resharper ignore an unused reference?

techvice

Using Resharper, we can right click on References for a project and select Optimize References. This shows us class libraries that are not in use or required by the compiler.

I have a class library that is only to be used as a reference (won't ever be a need to actually use the code). The dll is setup to inject itself upon start up as long as it is part of the references. In case you are curious why this would ever be done, it handles not found and errors for ASP.NET MVC projects (Nuget package page).

Is there any possible way that I can tell Resharper that this reference is either part of the required by the compiler or a part of the used references? I just want to try and prevent developers from removing my dll on accident.

Jalkar

You can interface Resharper with StyleCop. It allow warning in your code based on StyleCop settings. For each warning there is a way (using the "Resharper bubble") to disable a warning : http://tof.canardpc.com/view/49d10973-eb25-4a26-90b2-19d872083285.jpg

it's add a comment line in your code to disable alert on the warning ;

// ReSharper disable once RedundantUsingDirective
using My.Unused.Reference;

After some tests, saldy it seems Resharper doesn't care about that when you trigger the "Optimize Reference"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Is there a way to ignore unused undefined references?

From Dev

How can I have an unused type parameter in a struct?

From Dev

How can I have an unused type parameter in a struct?

From Dev

Is there a way to have my formulas reference a single cell value so that I can change multiple formulas with the one cell?

From Dev

How can I check XElements for null vals in a way that Resharper will accept?

From Dev

Is there a way to flag compiler to ignore unused imports?

From Dev

Can I have an interface parameter, pass by reference?

From Dev

How can I have git ignore the root level .vs directory?

From Dev

Can I have the shell ignore the command line sometimes but not always?

From Dev

How can I have git ignore the root level .vs directory?

From Dev

Can I have a one way HABTM relationship?

From Dev

Can I have an organized way to work with django?

From Dev

Why do I have to reference the user model this way

From Dev

Android AudioRecord is there a way to release when I no longer have a reference?

From Dev

Why does this GridBagLayout have unused empty space and how can I get rid of it?

From Dev

I have an error with unused variable warning

From Dev

Can I have my assembly reference any version of another assembly?

From Dev

Can I have a static borrowed reference to a trait object?

From Dev

How can I have the html root reference the application root (IIS)?

From Dev

Is there a way to capture JavaScript console output so I can reference it elsewhere?

From Dev

I have an overloaded setter on an object, how can I tell Jackson to ignore one of them?

From Dev

Is there a way to have assertPathIs() ignore part of the url?

From Dev

Automatically remove unused code with Resharper

From Dev

Automatically remove unused code with Resharper

From Dev

Is there a way I can have only action without view

From Dev

Is there a way I can have multiple number limits on different textboxes?

From Dev

Is there a way I can have my app communicate with an outside object?

From Dev

Is there a way I can make a parameter have a default with Typescript?

From Dev

Can I have a custom way to resolve conflicts in `Array#to_h`?

Related Related

  1. 1

    Is there a way to ignore unused undefined references?

  2. 2

    How can I have an unused type parameter in a struct?

  3. 3

    How can I have an unused type parameter in a struct?

  4. 4

    Is there a way to have my formulas reference a single cell value so that I can change multiple formulas with the one cell?

  5. 5

    How can I check XElements for null vals in a way that Resharper will accept?

  6. 6

    Is there a way to flag compiler to ignore unused imports?

  7. 7

    Can I have an interface parameter, pass by reference?

  8. 8

    How can I have git ignore the root level .vs directory?

  9. 9

    Can I have the shell ignore the command line sometimes but not always?

  10. 10

    How can I have git ignore the root level .vs directory?

  11. 11

    Can I have a one way HABTM relationship?

  12. 12

    Can I have an organized way to work with django?

  13. 13

    Why do I have to reference the user model this way

  14. 14

    Android AudioRecord is there a way to release when I no longer have a reference?

  15. 15

    Why does this GridBagLayout have unused empty space and how can I get rid of it?

  16. 16

    I have an error with unused variable warning

  17. 17

    Can I have my assembly reference any version of another assembly?

  18. 18

    Can I have a static borrowed reference to a trait object?

  19. 19

    How can I have the html root reference the application root (IIS)?

  20. 20

    Is there a way to capture JavaScript console output so I can reference it elsewhere?

  21. 21

    I have an overloaded setter on an object, how can I tell Jackson to ignore one of them?

  22. 22

    Is there a way to have assertPathIs() ignore part of the url?

  23. 23

    Automatically remove unused code with Resharper

  24. 24

    Automatically remove unused code with Resharper

  25. 25

    Is there a way I can have only action without view

  26. 26

    Is there a way I can have multiple number limits on different textboxes?

  27. 27

    Is there a way I can have my app communicate with an outside object?

  28. 28

    Is there a way I can make a parameter have a default with Typescript?

  29. 29

    Can I have a custom way to resolve conflicts in `Array#to_h`?

HotTag

Archive