HelloWorldのような単純なサービスを作成しようとしています。ただし、AppHostは次をスローします。
Method 'Add' in type 'ServiceStack.ServiceHost.ServiceRoutes' from assembly 'ServiceStack, Version=3.9.4.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
コード:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using ServiceStack.WebHost.Endpoints;
using Funq;
namespace Eagle
{
public class Global : System.Web.HttpApplication
{
public class TestAppHost : AppHostBase
{
//Tell Service Stack the name of your application and where to find your web services
public TestAppHost() : base("Test Web Services", typeof(TestService).Assembly) { }
public override void Configure(Container container)
{
//register user-defined REST-ful urls
Routes
.Add<Test>("/test")
.Add<Test>("/test/{Name}");
}
}
protected void Application_Start(object sender, EventArgs e)
{
try
{
new TestAppHost().Init();
}
catch (Exception ex)
{
}
}
}
}