2012-02-02 4 views
8

나는 ServiceStack의 안녕 예를 따르도록 노력하고있어. 저는 Visual Studio 2010, Win 7 64 비트를 사용하고 있지만 IIS는 32 비트 응용 프로그램을 실행하도록 구성되어 있습니다. 내가 만든 Hello 프로젝트는 ASP.Net MVC3을 사용하고 있습니다. 적절하게 충분한 - - ServiceStack - 나는 그것을라는 빈 ASP.NET 프로젝트를 만들 때ServiceStack 오류로드 웹 호스트에 엔드 포인트

Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.TypeLoadException: Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[TypeLoadException: Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.] 
    System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs) +0 
    System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs) +46 
    System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +529 
    System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +103 
    System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit) +64 
    WebActivator.AssemblyExtensions.GetActivationAttributes(Assembly assembly) +145 
    WebActivator.ActivationManager.RunActivationMethods() +216 
    WebActivator.ActivationManager.RunPreStartMethods() +43 
    WebActivator.ActivationManager.Run() +69 

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..] 
    System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423 
    System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306 
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677 

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'..] 
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9089964 
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 
    System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258 
+0

NuGet을 통해 ServiceStack을 어떻게 설치 했습니까? ServiceStack 및 WebActivator – mythz

+0

예, Nuget을 통해 업데이트하십시오. – cksanjose

+0

NuGet에서 최신 버전을 사용해 보았습니다. 저에게 좋습니다. 내부 WebDevServer를 사용할 때 작동합니까? (즉, 프로젝트 속성/웹/VS Dev WebServer 사용) – mythz

답변

9

내가 같은 문제로 실행 : 나는 메타 데이터에 액세스하려고이 오류가 발생합니다. (정품 인증 문제) ASP 프로젝트 이름 (및 해당 네임 스페이스)을 ServiceStackExperiment와 비슷한 것으로 업데이트했을 때 - 모든 것은 유니콘과 무지개였습니다.

16

이것은 아주 오래된 포스트이지만, ServiceStack 버전에 대한 개발을 할 때 비슷한 오류가 발생하면이 사람을 도움이 될 4. 복사하기로 결정하는 경우 Web.Config 파일에 필요한 약간의 비틀기가 있었다

및 serviceStack 버전 용으로 작성된 일부 servicestack 가이드에서 붙여 3.

필요합니다 ServiceStack.Webhost의 네임 스페이스가

HTTP 처리기 섹션은 다음

<httpHandlers> 
    <add path="*" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*"/> 
    </httpHandlers> 

    <handlers> 
    <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />   
    </handlers> 

같은 것을 변경한다 희망은 누군가를 돕는다!

+0

감사합니다. – derFunk

관련 문제