What is the purpose of WCF Service Library?

前端 未结 3 1454
耶瑟儿~
耶瑟儿~ 2020-12-14 16:04

What is the purpose of WCF Service Library? I understand if you build an IIS hosted service you create a web project, if self-hosted - create an .exe.

What is a rea

3条回答
  •  天命终不由人
    2020-12-14 16:28

    I would always create a WCF library as a class library - it's much easier to use. You have total flexibility to then either host your WCF service inside IIS (by supplying a virtual directory and a .svc file inside it), or you could write your own self-hosting EXE and reference the WCF service in the class library from it.

    Putting a WCF service directly into a web project seems like a really bad idea and might only be useful for very simple instructional purposes - just to show how to get started. I would never do this for a "live" system.

    Marc

提交回复
热议问题