I just recently went through one of our solutions, and removed unused references from every project. There is some concern that this could cause issues (perhaps needing references of references, or not playing nicely with Nuget). Does someone know if this operation is safe? Is it possible that it could remove something that is actually needed?
It is safe if you do not load assemblies dynamicly from code (eg., dependency injection with configuration saved in file, xml, json..., use Assembly.Load, ...). In other case needed assemblies could not be copied to destination folder when debug/publish application and you will get runtime errors if you do not copy them by yourself.
In most cases you do not do that in your solution and it is perfectly safe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With