I got around to some cleaning today removing all our project warnings, yes you know which I mean, those nasty yellow things in the bottom of your Visual Studio screen every time you build. The ones we shrug at and say “well, they’re just warnings” 🙂

I got most of them since they were really easy issues but at one point I actually wanted the “fault” to be implemented that way. We had a design time view model implementing the base interface which had an INotifyPropertyChanged interface (I could possible have moved this interface down a level to not get it on the design time view model but in some situations that might not be feasible). So, it would look something like this:

The code line generated that generated this was the following

As I mentioned, since I wanted/needed to implement this this interface I couldn’t just comment out the line and I don’t fancy putting in code to invoke it just to be rid of a warning. So, instead, if you have a look at the output view the build will give you this version of the warning:

The important bit here is the warning error code, in this case CS0067, removing the CS-bit we can use this with a preprocessor directive to temporarily remove this exclude this warning when compiling this bit of code, the end result:

And our warning is gone! I’m not a fan of these cluttering preprocessors but since this is something that will never be used and can be hidden in the design time class without risk I find it a neat alternative to changing your implementation or adding stuff that won’t be used.

Since you need to end with a proverb or catchphrase I’ll use one that annoyed my senior the other day 🙂

There is no problem without a solution, you just have to find it!

yeah, well, thanks a lot 🙂