Search code examples
.netwcfweb-configendpointglobal-asax

Which one is better & Why ? endpoints in global.asax OR end points in web.confing in WCF


My question is related to the endpoints in wcf project. Which one is the better way to define the endpoints? Either one should define the endpoints in global.asax or endpoints in web.config? Which one is the better way and why?


Solution

  • So you mean do you define the endpoints in code or in xml configuration?

    Well, they are functionally equivalent in every way, so from that perspective it's a personal choice.

    The only real difference is that if you define your endpoints as xml config then you're not baking the service management and infrastructure concerns into the assembly, which in my opinion is much betterer.