开发者

What hosting method can be used for a WCF service to prevent multiple service start?

开发者 https://www.devze.com 2023-03-31 15:01 出处:网络
I\'m developing a Client-Server Application which moderate Wireless Access Point. I want change Server Application to a service with WCF. What hosting method can be used? Service should run one time.

I'm developing a Client-Server Application which moderate Wireless Access Point.

I want change Server Application to a service with WCF. What hosting method can be used? Service should run one time.

I know i can host as windows service but It's to hard for me! I开发者_如何学运维f I use self-hosting with a Console Application (for example) ,this program ran 2 times,then two service will be hosted? (I know we can prevent an application from multiple running,but we should not prevent application from multiple running, we just prevent service from multiple hosting)


In Self-hosting you can't have two applications on the same computer serve the same URL - so if your Console application with self-hosting is started twice and uses the same URL for WCF Server then the second start will throw an exception that the URL is already in use practically preventing your WCF Service from being served by two applications at the same time...

0

精彩评论

暂无评论...
验证码 换一张
取 消