本文介绍了WcfFacility序列不包含任何元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到序列包含尝试安装我的WCF服务时,没有任何元素误差



下面是我的Global.asax代码:

  _container =新WindsorContainer(); 

_container.Register(Component.For< IWindsorContainer>()实例(_container)。)
.AddFacility< WcfFacility>()
.Install(Configuration.FromAppConfig())
.Install(FromAssembly.InDirectory(新AssemblyFilter(HttpRuntime.BinDirectory,网络的* .dll)));

下面是在web.config中我system.servicemodel部分:



< system.serviceModel>
< serviceHostingEnvironment aspNetCompatibilityEnabled =真/>
<客户端>
<端点地址=http://commandservice.website.com/WebsiteCommandService.svc绑定=basicHttpBinding的合同=CommandService.IWebsiteCommandServiceNAME =commandServiceClient>< /端点>
< /客户>
< /system.serviceModel>

和这里是我的城堡配置(在web.config中):



<&城堡GT;
<成分>
<成分
ID =commandService
型=CommandService.WebsiteCommandService,CommandService
wcfEndpointConfiguration =commandServiceClient/>
< /成分>
< /城堡>



我失去了一些东西明显?



更新:



这里是堆栈跟踪:



[出现InvalidOperationException:序列不包含任何元素]
System.Linq.Enumerable.Single(IEnumerable`1源)+371
Castle.Facilities.WcfIntegration.WcfClientExtension.ObtainServiceContract(ComponentModel模型,IWcfClientModel clientModel )在C:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:239
Castle.Facilities.WcfIntegration.WcfClientExtension.ResolveClientModel( ComponentModel模型)在C:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:234
Castle.Facilities.WcfIntegration.WcfClientExtension。 Kernel_ComponentModelCreated(ComponentModel型)在C:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:189
Castle.MicroKernel.ComponentModelDelegate。调用(ComponentModel模型)在D + 0
Castle.MicroKernel.DefaultKernel.AddCustomComponent(ComponentModel模型,布尔isMetaHandler):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ DefaultKernel.cs:281
Castle.MicroKernel.DefaultKernel.Register(IRegistration []注册)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel.cs :536
Castle.Windsor.WindsorContainer.Register(IRegistration []注册)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\WindsorContainer.cs:$ 482 b $ b Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration []配置,IWindsorContainer容器,IConversionManager转换器)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\Installer \DefaultComponentInstaller.cs:在D 211
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller []安装,DefaultComponentInstaller范围内):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor \WindsorContainer.cs:317
Castle.Windsor.WindsorContainer.Install(IWindsorInstaller []安装)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\WindsorContainer的.cs:453
Website.MvcApplication.ConfigureContainer()在C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\Global.asax.cs:65
Website.MvcApplication .Application_Start()在C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\Global.asax.cs:53

[HttpException(0x80004005的):序列不包含任何元素]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext的背景下,HttpApplication的应用程序)405205​​3
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr的appContext,HttpContext的背景下,MethodInfo的[]处理程序)+191
System.Web.HttpApplication.InitSpecial(HttpApplicationState状态,MethodInfo的[]处理器,IntPtr的appContext,HttpContext的背景下)+352
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr的appContext,HttpContext的背景下)407
系统。 Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr的appContext)+375

[HttpException(0x80004005的):序列不包含任何元素]
System.Web.HttpRuntime.FirstRequestInit(HttpContext的背景下)11686928
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext的背景下)+141
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest WR,HttpContext的背景下)4863749

更新



这个问题似乎是在其他地方了 - 它就像它试图解析组件,如果这是一个正常的对象不是一个WCF服务。霸菱考虑到维修工程 - 试图使用WCF我得到的构造函数的错误来解决它的时候:

 公共WebSiteCommandService( ICommandService服务)
{
_service =服务;
}



它说,有对ICommandService

$ B $没有组件b

为什么客户端容器试图解决?



这就像wcffacility的东西正在被完全跳过?



下面是堆栈:

  [InstanceNotFoundInEnvironmentConfigurationException:找不到请求的类型Ncqrs.Commanding.ServiceModel .ICommandService在NcqrsEnvironment配置。确保NcqrsEnvironment被正确配置,或默认值是否设置正确] 
Ncqrs.NcqrsEnvironment.Get()在C:\Users\Wayne Douglas\Dev\ProjectWebsite\ThirdParty\NCQRS\\ \\src\Ncqrs\NcqrsEnvironment.cs:用C 96
CommandService.WebsiteCommandService..cctor():\Users\Wayne Douglas\Dev\ProjectWebsite\CommandService\WebsiteCommandService.svc.cs :17

[TypeInitializationException:为CommandService.WebsiteCommandService'的类型初始值引发异常。]
System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType型)+ 0
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate构造,对象[]参数,类型implType)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator的.cs:151

[ComponentActivatorException:ComponentActivator:无法实例CommandService.WebsiteCommandService]
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate构造,对象[]参数,类型implType)在D:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:163
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext背景下,ConstructorCandidate构造函数,对象[]参数)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:116
Castle.MicroKernel.ComponentActivator。 DefaultComponentActivator.InternalCreate在D(CreationContext上下文):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:66
Castle.MicroKernel.ComponentActivator。 AbstractComponentActivator.Create在D(CreationContext情况下,负担的负担):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\AbstractComponentActivator.cs:80
Castle.MicroKernel .Lifestyle.AbstractLifestyleManager.CreateInstance在D(CreationContext背景下,布尔trackedExternally):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:81
Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve在D(CreationContext背景下,IReleasePolicy releasePolicy):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\SingletonLifestyleManager.cs:$ 63 b $ b Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext背景下,布尔requiresDecommission,布尔instanceRequired,炉料和放大器;负担)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:124
Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext背景下,布尔instanceRequired)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:98
Castle.MicroKernel.Resolvers.DefaultDependencyResolver。 ResolveCore(CreationContext背景下,ComponentModel模型,DependencyModel依赖)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver.cs:308
城堡。 MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext背景下,ISubDependencyResolver contextHandlerResolver,ComponentModel模型,DependencyModel依赖)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver。 CS:158
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate构造,CreationContext上下文)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\\ \\DefaultComponentActivator.cs:在D 292
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext上下文):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\\ \\DefaultComponentActivator.cs:在D 85
Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext上下文):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\\ \\DefaultComponentActivator.cs:66
Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext情况下,负担的负担)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\\ \\ComponentActivator\AbstractComponentActivator.cs:80
Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext背景下,布尔trackedExternally)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\\ \\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:81
Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext背景下,IReleasePolicy releasePolicy)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle .Windsor\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:70
Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext背景下,布尔requiresDecommission,布尔instanceRequired,炉料和放大器;负担)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:124
Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext背景下,布尔instanceRequired)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:98
Castle.MicroKernel.DefaultKernel.ResolveComponent( IHandler处理程序,服务类型,IDictionary的additionalArguments,IReleasePolicy政策)在d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:777
Castle.MicroKernel。 DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve在D(服务类型,IDictionary的争论,IReleasePolicy策略):\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel_Resolve.cs:$ 225 b $ b Website.WindsorControllerFactory.GetControllerInstance(RequestContext的RequestContext的,类型controllerType)在C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\WindsorControllerFactory.cs:24
System.Web.Mvc .DefaultControllerFactory.CreateController(的RequestContext的RequestContext,字符串controllerName)+93
System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase HttpContext的,一个IController&安培;控制器,IControllerFactory&安培;工厂)346
System.Web.Mvc<方式>&c__DisplayClass6 LT; BeginProcessRequest方式> b__2()+71
System.Web.Mvc<> c__DisplayClassb`1< ProcessInApplicationTrust> ; b__a()+19
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 FUNC)+161
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+ 405
System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,布尔和放大器; completedSynchronously)+375


解决方案

我终于得到这个工作!



在将接口所需的组件配置的类型 - 该服务。我离开了服务属性,它发射行动起来吧!



而system.servicemodel曾与客户端配置。



不知道这是不是一个错误?


I keep getting a Sequence contains no elements error when trying to install my wcf services.

here is the code in my global.asax:

_container = new WindsorContainer();

_container.Register(Component.For<IWindsorContainer>().Instance(_container))
          .AddFacility<WcfFacility>()
          .Install(Configuration.FromAppConfig())
          .Install(FromAssembly.InDirectory(new AssemblyFilter(HttpRuntime.BinDirectory, "Web*.dll")));

here is my system.servicemodel section in web.config:

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  <client>
    <endpoint address="http://commandservice.website.com/WebsiteCommandService.svc" binding="basicHttpBinding" contract="CommandService.IWebsiteCommandService" name="commandServiceClient"></endpoint>
  </client>
</system.serviceModel>

And here is my castle config (within the web.config):

<castle>
    <components>
      <component
          id="commandService"
          type="CommandService.WebsiteCommandService, CommandService"
          wcfEndpointConfiguration="commandServiceClient" />
    </components>
</castle>

Am I missing something obvious?

UPDATE:

here is the stack trace:

[InvalidOperationException: Sequence contains no elements]
   System.Linq.Enumerable.Single(IEnumerable`1 source) +371
   Castle.Facilities.WcfIntegration.WcfClientExtension.ObtainServiceContract(ComponentModel model, IWcfClientModel clientModel) in c:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:239
   Castle.Facilities.WcfIntegration.WcfClientExtension.ResolveClientModel(ComponentModel model) in c:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:234
   Castle.Facilities.WcfIntegration.WcfClientExtension.Kernel_ComponentModelCreated(ComponentModel model) in c:\TeamCity\buildAgent\work\a19756d977ce9d2c\src\Castle.Facilities.WcfIntegration\Client\WcfClientExtension.cs:189
   Castle.MicroKernel.ComponentModelDelegate.Invoke(ComponentModel model) +0
   Castle.MicroKernel.DefaultKernel.AddCustomComponent(ComponentModel model, Boolean isMetaHandler) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:281
   Castle.MicroKernel.DefaultKernel.Register(IRegistration[] registrations) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:536
   Castle.Windsor.WindsorContainer.Register(IRegistration[] registrations) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\WindsorContainer.cs:482
   Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\Installer\DefaultComponentInstaller.cs:211
   Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\WindsorContainer.cs:317
   Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\Windsor\WindsorContainer.cs:453
   Website.MvcApplication.ConfigureContainer() in C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\Global.asax.cs:65
   Website.MvcApplication.Application_Start() in C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\Global.asax.cs:53

[HttpException (0x80004005): Sequence contains no elements]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +4052053
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +352
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

[HttpException (0x80004005): Sequence contains no elements]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11686928
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4863749

UPDATE

the problem seems to be somewhere else now - it's like it's trying to resolve the component as if it were a normal object not a wcf service. baring in mind the service works - when trying to resolve it using the wcf i get an error on the ctor:

    public WebSiteCommandService(ICommandService service)
    {
        _service = service;
    }

It says that there is no component for ICommandService

why is the client container trying to resolve that?

it's like the wcffacility stuff is being skipped completely?

Here is the stack:

[InstanceNotFoundInEnvironmentConfigurationException: Could not find requested type Ncqrs.Commanding.ServiceModel.ICommandService in the NcqrsEnvironment configuration. Make sure that the NcqrsEnvironment is configured correctly or that defaults are correctly set.]
   Ncqrs.NcqrsEnvironment.Get() in C:\Users\Wayne Douglas\Dev\ProjectWebsite\ThirdParty\NCQRS\src\Ncqrs\NcqrsEnvironment.cs:96
   CommandService.WebsiteCommandService..cctor() in C:\Users\Wayne Douglas\Dev\ProjectWebsite\CommandService\WebsiteCommandService.svc.cs:17

[TypeInitializationException: The type initializer for 'CommandService.WebsiteCommandService' threw an exception.]
   System.Runtime.Serialization.FormatterServices.nativeGetUninitializedObject(RuntimeType type) +0
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:151

[ComponentActivatorException: ComponentActivator: could not instantiate CommandService.WebsiteCommandService]
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:163
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:116
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:66
   Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\AbstractComponentActivator.cs:80
   Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:81
   Castle.MicroKernel.Lifestyle.SingletonLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\SingletonLifestyleManager.cs:63
   Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:124
   Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:98
   Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ComponentModel model, DependencyModel dependency) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver.cs:308
   Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Resolvers\DefaultDependencyResolver.cs:158
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:292
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:85
   Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\DefaultComponentActivator.cs:66
   Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\ComponentActivator\AbstractComponentActivator.cs:80
   Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:81
   Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Lifestyle\AbstractLifestyleManager.cs:70
   Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:124
   Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\Handlers\DefaultHandler.cs:98
   Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel.cs:777
   Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy) in d:\BuildAgent\work\60b7fa65294e7792\src\Castle.Windsor\MicroKernel\DefaultKernel_Resolve.cs:225
   Website.WindsorControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) in C:\Users\Wayne Douglas\Dev\ProjectWebsite\Website\WindsorControllerFactory.cs:24
   System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +93
   System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +346
   System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +71
   System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +19
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +161
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +405
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375
解决方案

I finally got this working!!

the type in the component config needed to be the interface - the service. I left out the service attribute and it fired into action!

And the system.servicemodel worked with client config.

Don't know if this is a bug?

这篇关于WcfFacility序列不包含任何元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 07:37