2014-06-18 4 views
0

추적 할 수없는 원인으로 몇 가지 오류가있는 Asp.Net MVC 응용 프로그램이 있습니다. 나는 그것들이 관련되어 있다고 생각하지만 ServiceStack에 대해서는 익숙하지 않다. 우선 들어ServiceStack.Text.JsConfig.With (...) 메서드가 없습니다?

, 내가 던진 다음과 같은 예외가보고 계속 :

Method not found: 'ServiceStack.Text.JsConfigScope ServiceStack.Text.JsConfig.With(
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<ServiceStack.Text.DateHandler>, 
System.Nullable`1<ServiceStack.Text.TimeSpanHandler>, 
System.Nullable`1<ServiceStack.Text.PropertyConvention>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.String, System.Func`2<System.Type,System.String>, 
System.Func`2<System.String,System.Type>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, 
System.Nullable`1<Int32>, ServiceStack.EmptyCtorFactoryDelegate, 
System.String[])'. 

이 방법은 실제로 비록 내 자신의 코드에서 호출되지 않습니다. 이 오류는 ServiceStack 내에서 계속 발생하는 것 같습니다. 그 후 저에게이 같은 스택 추적을주지

using ServiceStack; 

namespace MyWebProject.ServiceInterface 
{ 
    public abstract class AppServiceBase : Service 
    { 
     public virtual UserSession UserSession 
     { 
      get { 
       return SessionAs<UserSession>(); // Throws an error when called 
      } 
     } 
    } 
} 

AppServiceBase.cs :

[MissingMethodException: Method not found: 'ServiceStack.Text.JsConfigScope ServiceStack.Text.JsConfig.With(System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<ServiceStack.Text.DateHandler>, System.Nullable`1<ServiceStack.Text.TimeSpanHandler>, System.Nullable`1<ServiceStack.Text.PropertyConvention>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.String, System.Func`2<System.Type,System.String>, System.Func`2<System.String,System.Type>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Boolean>, System.Nullable`1<Int32>, ServiceStack.EmptyCtorFactoryDelegate, System.String[])'.] 
    ServiceStack.Redis.RedisClient.Exec(Func`2 action) +0 
    ServiceStack.Redis.RedisClient.Get(String key) +241 
    ServiceStack.Redis.RedisClientManagerCacheClient.Get(String key) +142 
    ServiceStack.SessionExtensions.SessionAs(ICacheClient cache, IRequest httpReq, IResponse httpRes) +150 
    ...Where it was called from and the rest of the stack. 

이 아무것도 일어날 것 같다 입력 된 세션을 얻을하려고 할 때 하나의 예입니다 어딘가에 JsConfig.With()을 호출합니다. 이 문제의 원인에 대한 통찰력은 대단히 감사하겠습니다.

+1

소리가 잠재적 인 버전 불일치와 같습니다. 'ServiceStack.Text.dll'의 버전이'ServiceStack.Redis.dll'과 같은지 확인하십시오. – mythz

+0

@mythz 그게 전부였습니다. 내가 원하는대로 의견을 말하고 싶다면 멋지다. – jfelsinger

답변

3

메서드 서명이 어셈블리간에 일치하지 않거나 런타임이 MissingMethodException 인 경우 종속성간에 버전이 일치하지 않아 NuGet 패키지를 업데이트해야 해결 될 수 있습니다.

ServiceStack 라이브러리는 동일한 버전 번호와 함께 잠금 단계로 배포되므로 어셈블리 버전 정보를 비교하여 dll이 동일한 버전인지 여부를 알 수 있습니다.

관련 문제