如何判断VS.NET设计时?

方法一:

if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv")
//...Then Continue

方法二:

if(System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime)
//... Then Continue

没有测试过,感觉可行。

原文地址:https://www.cnblogs.com/eastson/p/4203939.html