2012-09-12 4 views
1

저는 HelloWorld처럼 간단한 서비스를 만들려고합니다. 그러나 AppHost을 던지고있다 :간단한 서비스에서의 ServiceStack 예외

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) 
      { 
      } 
     } 
    } 
} 

답변

2

Routes.Add<T>ServiceStack.ServiceInterface 네임 스페이스 확장 방법, 당신은 추가 할 필요가 그것을 사용할 수 있도록 :

using ServiceStack.ServiceInterface; 

누락 된 C#의 네임 스페이스를 자동으로 해결하는 ReSharper를 사용하는 것이 좋습니다.