2012-02-02 22 views
8

ServiceStack'ın Hello örneğini takip etmeye çalışıyorum. Visual Studio 2010 kullanıyorum, Win 7 64-bit, ancak IIS 32-bit uygulamaları çalıştırmak için yapılandırıldı. Oluşturduğum Hello projesi ASP.Net MVC3 kullanıyor. uygun bir şekilde yeterli - - ServiceStack - Ben bunu denilen Boş ASP.NET proje oluştururkenServiceStack Hatası WebHost Bitiş Noktası Yükleme

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

ServiceStack'ı NuGet üzerinden nasıl yüklediniz? Nuget aracılığıyla ServiceStack ve WebActivator – mythz

+0

Evet'i güncelleştirmeyi deneyin. – cksanjose

+0

Sadece en son sürümü NuGet denedim, benim için çalışıyor. Dahili WebDevServer'ı kullanırken çalışır mı? (örn. Project Properties/Web/Use VS Dev WebServer) – mythz

cevap

9

Ben aynı sorun koştu: Ben meta erişmeye çalışırken bu hata alıyorum. (Aktivasyon problemi) ASP proje adımı (ve tüm ilgili Ad alanlarını) ServiceStackExperiment'e benzer bir şeyle güncelleştirdiğimde, her şey tek boynuzlu ve gökkuşaklarıydı.

16

Bu çok eski bir yazı olduğunu, ancak ServiceStack sürümü karşı geliştirirken onlar da benzer bir hata aldı eğer bu kimse yardımcı olabilecek 4. kopyalamak için karar eğer Web.Config dosyasında gerekli bazı ince ayarlar vardı

ve serviceStack sürümü için yazılmış bazı servicestack rehberlerinden yapıştırmak 3.

gerekecektir ServiceStack.Webhost ad alanına sahip

Http işleyicisi bölümleri aşağıdaki

<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> 

gibi bir şey değiştirilecek Umarım birisine yardım eder!

+0

Teşekkürler, bu yardımcı oldu! – derFunk

İlgili konular