I have this code in an assembly:
public class Class1
{
public const int x = 10;
}
and in a different assembly I have:
class Program
{
static void Main(string[] args)
{
Console.WriteLine(Class1.x);
Console.ReadKey();
}
}
Of course the output was 10
, but then I changed x
to 20
:
public class Class1
{
public const int x = 20;
}
I recompiled the assembly and moved it to my command line program's bin directory. However, the output of my program was still 10
, until I compiled assembly containing the main
function.
Why is this happening?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…