Repository navigation
EN CSharp Keyword namespace
Codex edited this page Oct 11, 2026
·
2 revisions
Українська · Русский · English · Deutsch · Français · Italiano · Español · 繁體中文 · 日本語 · 한국어
Organizes types and prevents name conflicts. You can use a block or file-scoped declaration.
Save this example separately as Example.cs. Run it independently of the other examples on this page.
Example.cs:
// PROJECT-EXAMPLE
namespace MyTools;
class Item { public string Name => "Ore"; }Declaration only: this code compiles as a library; call it from Main to run it.
namespace Name { ... } / namespace Name;using System; namespace GameTools { public static class Program { public static void Main() { Console.WriteLine(typeof(Program).FullName); } } }using System; namespace MyTools; public static class Program { public static void Main() { Console.WriteLine(typeof(Program).Namespace); } }Official source: Microsoft Learn.
ClassicUO — Bad Newbie & C# Scripts IDE