My C# project - we'll call it the SuperUI - used to make use of a class from an external assembly. Now it doesn't, but the compiler won't let me build the project without the assembly reference in place. Let me elaborate.
This project used to throw and catch a custom exception class - the SuperException
- which was derived from the standard System.Exception and lived in a separate, precompiled assembly, SuperAssembly.DLL
, which I referenced.
Eventually, I decided this was a pointless exercise and replaced all SuperExceptions
with a System.SuitableStandardException in each case. I removed the reference to SuperException.DLL
, but am now met with the following on trying to compile the project:
The type 'SuperException' is defined in an assembly that is not referenced. You must add a reference to assembly 'SuperException, Version=1.1.0.0 (...)'
The source file referenced by the error doesn't seem relevant; it's the project namespace that gets highlighted in the IDE.
Now, here's the thing:
- All uses of
SuperException
have been eliminated from the project's code. - Compared to another project that compiles fine without a reference to
SuperException.DLL
, I only reference one more assembly - andthat
references nothing that my project doesn't reference itself. While it's possible that any of these dependencies could throwSuperExceptions
, I'm only catching the base Exception class and in any case... the other project builds fine! - I've done Visual Studio's "Clean Solution" and cleared everything out by hand, many times.
It's not the end of the world to include this reference, I just don't see why it's necessary any more. Nrrrgg. Any pointers welcome!