Repository navigation
EN CSharp Directive Pragma
Codex edited this page Oct 11, 2026
·
2 revisions
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
warning disable/restore changes the selected warnings. checksum specifies the checksum for the debug information of the generated source.
Save this example separately as Example.cs. Run it independently of the other examples on this page.
Example.cs:
// PROJECT-EXAMPLE
#pragma warning disable CS0168
int unused;
#pragma warning restore CS0168
System.Console.WriteLine("Ready");Result:
Ready
#pragma warning disable CODE / restore CODEusing System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
#pragma warning disable CS0168
int unused;
#pragma warning restore CS0168
Console.WriteLine("Ready");
}
}#pragma checksum "Generated.cs" "{8829d00f-11b8-4213-878b-770e8597ac16}" "00112233445566778899AABBCCDDEEFF"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
public static class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("Source mapped");
}
}Official source: Microsoft Learn.
ClassicUO — Bad Newbie & C# Scripts IDE