Custom compiler warnings in Visual Studio 2008

Custom compiler and
C # warnings: creating your own warning in Visual Studio if a specific method is used in the source code
did not help, since they deal with code that is under the control of the author.

We use a third-party user interface control pack (DevExpress) in our software, and I want to generate a warning when someone uses MessageBox.Show("blah");insteadXtraMessageBox.Show("blah");

Is there any way to do this?

+3
source share
3 answers

FxCop/Visual Studio. Visual Studio Developer Edition, , IDE.

+5

.NET, ( , ), , , .

, , :

+2

. , , .

If you really want this, you can use the Reflection methods on your build assembly to check if any methods / assemblies you don't want are called. Cecil has many required features. You can then complete this part of the build process.

+1
source

Source: https://habr.com/ru/post/1719985/


All Articles