Hi,
Our app is writen in .NET 3.5 and for some clients or with some our modules 
we require the app to run in .NET 4.0 runtime (in app.config by: 
*<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>*). 
The problem is only with 4.0 runtime. When we not force the app to run in 
4.0 runtime, but let it run normally (in 2.0 runtime) everything works.

Dne pondělí 23. března 2015 15:23:46 UTC+1 Filip Kinsky napsal(a):
>
> Hello,
> I was trying Visual Studio 2015 CTP and got ASP.NET 4.6 upgrade during 
> the VS installation. I use Windsor WCF integration, which seems to get 
> broken due to this upgrade. I'm 
> injecting Castle.Facilities.WcfIntegration.IWcfClientFactory to my services 
> and use this simple extension method to retrieve the WCF client:
>
>         public static T GetClient<T>(this IWcfClientFactory factory) where 
> T : class
>         {
>             var componentName = typeof (T).FullName;
>             return factory.GetClient<T>(componentName);
>         }
>
>
> The GetClient method throws this exception after the upgrade:
>
> Castle.MicroKernel.ComponentActivator.ComponentActivatorException: 
> WcfClientActivator: could not proxy component XXX ---> System.
> NullReferenceException: Object reference not set to an instance of an 
> object.
>    at System.RuntimeMethodHandle.GetHashCode()
>    at System.Collections.Generic.ObjectEqualityComparer`1.GetHashCode(T 
> obj)
>    at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
>    at System.ServiceModel.Dispatcher.OperationSelectorBehavior.
> MethodInfoOperationSelector..ctor(ContractDescription description, 
> MessageDirection directionThatRequiresClientOpSelection)
>    at System.ServiceModel.Dispatcher.OperationSelectorBehavior.System.
> ServiceModel.Description.IContractBehavior.ApplyClientBehavior(
> ContractDescription description, ServiceEndpoint endpoint, ClientRuntime 
> proxy)
>    at System.ServiceModel.Description.DispatcherBuilder.
> ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime 
> clientRuntime)
>    at System.ServiceModel.Description.DispatcherBuilder.BuildProxyBehavior
> (ServiceEndpoint serviceEndpoint, BindingParameterCollection& parameters)
>    at System.ServiceModel.Channels.ServiceChannelFactory.
> BuildChannelFactory(ServiceEndpoint serviceEndpoint, Boolean 
> useActiveAutoClose)
>    at System.ServiceModel.ChannelFactory.CreateFactory()
>    at System.ServiceModel.ChannelFactory.OnOpening()
>    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan 
> timeout)
>    at System.ServiceModel.ChannelFactory.EnsureOpened()
>    at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress 
> address, Uri via)
>    at System.ServiceModel.ChannelFactory`1.CreateChannel()
>    at Castle.Facilities.WcfIntegration.WcfClientActivator.<>
> c__DisplayClass6.<GetChannelCreator>b__1()
>    at Castle.Facilities.WcfIntegration.WcfChannelHolder.CreateChannel()
>    at Castle.Facilities.WcfIntegration.WcfChannelHolder..ctor(
> ChannelCreator channelCreator, IWcfBurden burden, Nullable`1 closeTimeout)
>    at 
> Castle.Facilities.WcfIntegration.WcfClientActivator.Instantiate(CreationContext
>  
> context)
>    --- End of inner exception stack trace ---
>    at 
> Castle.Facilities.WcfIntegration.WcfClientActivator.Instantiate(CreationContext
>  
> context)
>    at 
> Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext
>  
> context)
>    at 
> Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext
>  
> context, Burden burden)
>    at 
> Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext
>  
> context, Boolean trackedExternally)
>    at 
> Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext 
> context, IReleasePolicy releasePolicy)
>    at 
> Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext 
> context, Boolean requiresDecommission, Boolean instanceRequired, Burden& 
> burden)
>    at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext 
> context, Boolean instanceRequired)
>    at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext 
> context)
>    at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, 
> Type service, IDictionary additionalArguments, IReleasePolicy policy)
>    at 
> Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(String
>  
> key, Type service, IDictionary arguments, IReleasePolicy policy)
>    at 
> Castle.Facilities.WcfIntegration.WcfClientFactorySelector.<>c__DisplayClass2.<SelectComponent>b__1(IKernelInternal
>  
> k, IReleasePolicy p)
>    at 
> Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Resolve(IInvocation
>  
> invocation)
>    at 
> Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Intercept(IInvocation
>  
> invocation)
>    at Castle.DynamicProxy.AbstractInvocation.Proceed()
>    at Castle.Proxies.IWcfClientFactoryProxy.GetClient[T](String name)
>
> There's obviously some breaking change in ASP.NET 4.6 WCF. I already 
> tried to debug the Windsor source code, bud wasn't able to understand the 
> code enough to be able to figure out where the problem is. Did anyone faced 
> the same problem? Any hints what to try to workaround the problem?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to