Skip to content

Instantly share code, notes, and snippets.

@demius
Created September 1, 2016 09:19
Show Gist options
  • Save demius/7f926f2d05c32edd3a3ba832852752e0 to your computer and use it in GitHub Desktop.
Save demius/7f926f2d05c32edd3a3ba832852752e0 to your computer and use it in GitHub Desktop.
Extensionless WCF service hosting using ASP.NET Routing
using System;
using System.ServiceModel.Activation;
using System.Web.Routing;
namespace ACME.Services
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
private void RegisterRoutes(RouteCollection routes)
{
routes.Add(new ServiceRoute("SampleWcfService", new ServiceHostFactory(), typeof(ACME.Services.SampleWcfService)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment