Disable Warnings Enhancements C# with Example



Disable Warnings Enhancements C# with Example

In C# 5.0 and earlier the developer could only suppress warnings by number. With the introduction of Roslyn 
Analyzers, C# needs a way to disable warnings issued from specific libraries. With C# 6.0 the pragma directive can 
suppress warnings by name. 
Before: 
 

#pragma warning disable 0501 
C# 6.0: 
#pragma warning disable CS0501 
 

Method/Modifier with Parameter Details 
Type 
T is the return type 

0 Comment's

Comment Form

Submit Comment