Because .NET use very late binding....Classes that are never used are also never loaded into memory. But when they finally needed then CLR needs time to load and initialize them. In case of unhandled exception CLR needs additional time to collect information for use in debbuger (and to show up a message).But in your case I will rather blame JIT compiler for that delay... (haven't looked at your project too.. ) You can try to sign assembly and use ngen.exe (and gacutil)- i think its worth try.
当第二次运行时,运行时先会缓存中去寻找,若找到了,就不用再编译一次,
所以么,以后运行将就快了!!
(haven't looked at your project too.. ) You can try to sign assembly and use ngen.exe (and gacutil)- i think its worth try.
bin\Debug\cs_TextBox.exe
obj\Debug\cs_TextBox.exe
速度非常快。如果在.net编译器MS2003下运行速度竟然是如此的慢(尤其是第一次出现异常的时候)?