resharper-nuget
resharper-nuget copied to clipboard
Adds reference to bin folder when no-one is referencing a nuget package
- Given a solution with a single project which has a nuget package installed
- Build the project
- Remove the reference. The dll is still in the bin dir
- Close and reopen the solution
- Alt+Enter on the invalid code will offer to add a reference to the dll in the bin dir
Since no-one else is referencing the package, ReSharper doesn't know about the dll in the package dir, even though it's "installed" in the project. Instead, it only knows about the dll in the bin dir. The plugin doesn't join the dots to know that there is a dll in the package that would help.
Possible solutions:
- Tell ReSharper about the dlls in packages - this would presumably require knowing how NuGet resolves the target framework folder, especially for PCL references
- Deny adding a reference to a dll in a bin folder. This feels more like a fix that ReSharper should handle itself. Also, the interface doesn't really support denying adding a reference. We can (and do) fudge it though.
About third step - remove reference or remove package, which including reference?
I removed the reference only, leaving the package "installed", i.e. it's still there in the packages.config, so nuget still thinks it's installed, but the dll isn't referenced.