Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2010 加载WebHost终结点时ServiceStack出错_Visual Studio 2010_Windows 7_64 Bit_<img Src="//i.stack.imgur.com/WM7S8.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">servicestack - Fatal编程技术网 servicestack,Visual Studio 2010,Windows 7,64 Bit,servicestack" /> servicestack,Visual Studio 2010,Windows 7,64 Bit,servicestack" />

Visual studio 2010 加载WebHost终结点时ServiceStack出错

Visual studio 2010 加载WebHost终结点时ServiceStack出错,visual-studio-2010,windows-7,64-bit,servicestack,Visual Studio 2010,Windows 7,64 Bit,servicestack,我试图遵循ServiceStack的Hello示例。我使用的是Visual Studio 2010 Win 7 64位,但IIS配置为运行32位应用程序。我创建的Hello项目使用ASP.NETMVC3。我在尝试访问元数据时遇到以下错误: Could not load type 'ServiceStack.WebHost.Endpoints.AppHostBase' from assembly 'ServiceStack, Version=1.0.0.0, Culture=neutral, Pu

我试图遵循ServiceStack的Hello示例。我使用的是Visual Studio 2010 Win 7 64位,但IIS配置为运行32位应用程序。我创建的Hello项目使用ASP.NETMVC3。我在尝试访问元数据时遇到以下错误:

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

我遇到了同样的问题——当我创建空的ASP.NET项目时,我非常恰当地将其称为ServiceStack。(激活问题)
当我将我的ASP项目名称(以及所有相应的名称空间)更新为类似于ServiceStackExperience的名称时,一切都是独角兽和彩虹

这是一篇非常古老的文章,但如果某人在针对ServiceStack版本4进行开发时遇到类似错误,这可能会有所帮助

如果您决定从为servicestack版本3编写的某些servicestack指南中复制和粘贴,则需要对Web.Config文件进行一些调整

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


希望它能帮助别人

您是如何通过NuGet安装ServiceStack的?尝试更新ServiceStack和WebActivator刚刚在NuGet上尝试了最新版本,对我有用。当您使用内部WebDevServer时,它是否工作?(即在projectproperties/Web/Use VS-Dev-WebServer中)已经设置为使用VS-Dev服务器。我想是web.config文件。有一条消息表明找不到位置元素“ServiceStack”。谢谢你的帮助!!注意:如果通过NuGet安装,location元素上的自定义路径应该是“api”而不是“servicestack”。您是否尝试过手动安装以及通过NuGet安装?我会移除一切,重新开始。