Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用一些服务创建了简单的 WCF 服务项目。如何Main()在控制台应用程序、Application_Start()WPF App.cs 或 ASP.NET global.asax.cs 中定义项目条目逻辑?
Main()
Application_Start()
Put the logic in the static constructor of the Service class. If Service is IService1, put it in
static Service1() { }
It will be called only once one service start.