Recently in the development of a system in C #, using to Lucene.Net, because the loaded source version is too old, compile will be reported many warnings, but does not affect the correct execution of the code. Efforts have been made to discover the following two ways to remove compilation warnings.
1, because it is for the entire project to hide the compilation warning, so you can in the project properties of the "Generate" tab in the "Suppress warning" field to enter the warning number you need to hide, separated by commas between multiple numbers. See:
2, if you need to hide the warning of a class, you can use the #pragma warning disable preprocessing command, multiple warning numbers that need to be hidden are separated by commas, and if you do not follow any numbers, hide all warnings. As shown in the following:
#pragma warning Disable 618,414public class lucenehelper{ int i = 0;//CS0414: Field "VME. Lucene.lucenehelper.i "is assigned, but its value has never been used}
you can use the #pragma warning restore preprocessing command to restore the warning. #pragma warning command is only valid for the current CS file.
How Visual Studio hides compilation warnings