You could use #pragma warning
to disable and then re-enable particular warnings:
public class MyClass
{
#pragma warning disable 0649
// field declarations for which to disable warning
private object foo;
#pragma warning restore 0649
// rest of class
}
Refer to Suppressing “is never used” and “is never assigned to” warnings in C# for an expanded answer.
Related Contents:
- Suppressing “is never used” and “is never assigned to” warnings in C#
- Difference Between Select and SelectMany
- Use LINQ to get items in one List, that are not in another List
- C# difference between == and Equals()
- What is a good pattern for using a Global Mutex in C#?
- Generic type conversion FROM string
- MVVM: Tutorial from start to finish?
- Custom header to HttpClient request
- What are .NET Assemblies?
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- Random date in C#
- Get the IP address of the remote host
- in a “using” block is a SqlConnection closed on return or exception?
- How To Change DataType of a DataColumn in a DataTable?
- Extension methods cannot be dynamically dispatched
- Filtering fiddler to only capture requests for a certain domain
- The type or namespace name ‘Objects’ does not exist in the namespace ‘System.Data’
- How do you multi-target a .NET Core class library with csproj?
- List vs BindingList Advantages/DisAdvantages
- Variables within app.config/web.config
- How do I create dynamic properties in C#?
- How does Objective-C compare to C#? [closed]
- Why can’t I have protected interface members?
- Convert `List` to comma-separated string
- Default parameter for value must be a compile time constant?
- programmatically add column & rows to WPF Datagrid
- How to create an instance of System.IO.Stream stream
- Entity Framework – Cannot convert lambda expression to type ‘string’ because it is not a delegate type
- Todo tasks not appearing in the Task List in visual studio 2012
- How can I generate a cryptographically secure pseudorandom number in C#?
- Recommended ServiceStack API Structure
- How can I call (Iron)Python code from a C# app?
- Why does C# allow statements after a case but not before it?
- Sending reference of object before its construction
- Generics open and closed constructed types
- Using a .NET DLL in Node.js / serverside javascript
- Convert / Cast IEnumerable to IEnumerable
- Entity Framework (EF) Code First Cascade Delete for One-to-Zero-or-One relationship
- Is there any simple way to convert .xls file to .csv file? (Excel)
- Are C# arrays thread safe?
- Singleton httpclient vs creating new httpclient request
- Null value when Pass values [FromBody] to post method by Postman plugin [duplicate]
- WPF DataBinding: Nullable Int still gets a validation error?
- The new null-conditional operator in ASP.NET MVC Razor
- How to retrieve data from a SQL Server database in C#?
- How to verify ILogger.Log extension method has been called using Moq?
- How to use linq to find the minimum [duplicate]
- Last and LastOrDefault not supported
- How to set Entity Framework Core migration timeout?
- Set timeout to an operation