.NET Fiddle

CSharp · Console

/Program.cs

using System;

public class Test
{
	public const string Foo = "Bar";
}

public class Program
{
	public static void Main()
	{
		Console.WriteLine(nameof(Test.Foo));
	}
}
;