Any VS C # method to list all the `throw new NotImplementedException ()` methods?

Is there any lazy way to list all methods that have only throw new NotImplementedException(); in your body ... which is built into Visual Studio C #? Something similar to the (Todo) Task List Pane , but will it be just a list of such empty placement labels that are explicitly expected / awaiting implementation?

It would be useful to implement interfaces and keep track of things easily.

+4
source share
3 answers

Here's a hack that you can use this evil, but it works. Add the following class to the project. Just remember to get rid of it before releasing it for production or making it compatible with the original.

 namespace System { [Obsolete("Fix this")] public class NotImplementedException : Exception { public NotImplementedException() : base() {} public NotImplementedException(string message) : base(message) {} public NotImplementedException(string message, Exception innerException) : base(message, innerException) {} protected NotImplementedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) {} } } 

This will cause all NotImplementedExceptions in your code to display as warnings.

This is a type interception method for source code that I used once or twice before. I usually do not recommend doing such things unless you really know what you are doing.

+3
source

Have you tried CTRL+SHIFT+F and searched for *.cs files for NotImplementedException ?

+7
source

Go to Object Browser ( Ctrl + Alt + J ).
Find the NotImplementedException class.
Right-click on it and select Find All Links.

+3
source

All Articles