方法一:
if (System.Diagnostics.Process.GetCurrentProcess().ProcessName == "devenv") //...Then Continue
方法二:
if(System.ComponentModel.LicenseManager.UsageMode == System.ComponentModel.LicenseUsageMode.Designtime) //... Then Continue
没有测试过,感觉可行。
Powered by: 博客园 Copyright © 2024 eastson Powered by .NET 8.0 on Kubernetes