problems using 2.1 Castle.Core.Interceptor.IInterceptor with IIS7 and unsigned assemblies

249 views
Skip to first unread message

jj

unread,
Aug 25, 2010, 5:58:52 PM8/25/10
to Castle Project Users
I am having problems using 2.1 Castle.Core.Interceptor.IInterceptor
with IIS7 and unsigned assemblies (no strong-name).

When the service is called, I get the exception below. If I comment
out line #7, everything 'works'...except my interceptor is obviously
not included.
Are DP interceptors supported in IIS7 with non-signed components?


global.asax.cs
---------------------
1 container.Register(
2 AllTypes.Of<IService>()
3 .FromAssembly(System.Reflection.Assembly.GetExecutingAssembly())
4 .WithService.FirstInterface()
5 .Configure(configurer => configurer.LifeStyle.Transient)
6 .Configure(configurer =>
configurer.Named(configurer.Implementation.FullName))
7 .Configure(configurer =>
configurer.Interceptors<Performance.Interceptors.StopwatchInterceptor>())
8 .Configure(configurer => configurer.ActAs(
9 new DefaultServiceModel()
10 .AddEndpoints(WcfEndpoint.BoundTo(customBinding))
11 .Hosted()
12 )
13 )
14 );



----------- runtime exception ---------
Exception:
System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]:
Could not load file or assembly 'Blaz.House.DomainModel,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
dependencies. A strongly-named assembly is required. (Exception from
HRESULT: 0x80131044) (Fault Detail is equal to An ExceptionDetail,
likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.IO.FileLoadException: Could not load file or assembly
'Blaz.House.DomainModel, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its dependencies. A strongly-named
assembly is required. (Exception from HRESULT: 0x80131044)
at
Castle.Proxies.Invocations.IStudyService_FindStudies.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at
Performance.Interceptors.StopwatchInterceptor.Intercept(IInvocation
invocation) in E:\dev\_Mainline\Blaz.House.Services.Admin\Interceptors
\StopWatchInterceptor.cs:line 77
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.IStudyServiceProxy.FindStudies(RequestContext
context, FindStudiesRequest request)
at SyncInvokeFindStudies(Object , Object[] , Object[] )
at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object
instance, Object[] inputs, Object[...)

Krzysztof Koźmic

unread,
Aug 25, 2010, 8:12:55 PM8/25/10
to castle-pro...@googlegroups.com
that's an exception that CLR throws when you're trying to load
non-strongly named assembly from strongly named assembly.
The solution is to strongly name all of your assemblies or none.

Krzysztof

jj

unread,
Aug 25, 2010, 10:10:28 PM8/25/10
to Castle Project Users
Thank you for taking the time to respond.

We don't sign any of our project assemblies and without the
interceptor (line#7) everything is working perfectly fine. As soon
as we add line#7 (interceptor) we run into problems.
The interceptor implementation does use a few .Net Framework
dependencies, which are signed by MSFT, but that's it as far as I can
determine.

If I understand you correctly, you are saying we will not be able to
use Dynamic Proxy AOP interceptors unless all assemblies loaded by the
generated proxy class are also signed?

Is there a way we can force DP to create an unsigned proxy?


On Aug 25, 5:12 pm, Krzysztof Koźmic <krzysztof.koz...@gmail.com>
wrote:

Krzysztof Koźmic

unread,
Aug 25, 2010, 10:12:37 PM8/25/10
to castle-pro...@googlegroups.com

Yes, pass true to ModuleScope .ctor

You will need custom proxy factory

sent from my HTC Desire

On 26/08/2010 12:10 PM, "jj" <jjlis...@gmail.com> wrote:

Thank you for taking the time to respond.

We don't sign any of our project assemblies and without the
interceptor (line#7)  everything is working perfectly fine.  As soon
as we add line#7 (interceptor) we run into problems.
The interceptor implementation does use a few .Net Framework
dependencies, which are signed by MSFT, but that's it as far as I can
determine.

If I understand you correctly, you are saying we will not be able to
use Dynamic Proxy AOP interceptors unless all assemblies loaded by the
generated proxy class are also signed?

Is there a way we can force DP to create an unsigned proxy?


On Aug 25, 5:12 pm, Krzysztof Koźmic <krzysztof.koz...@gmail.com>
wrote:

>   that's an exception that CLR throws when you're trying to load

> non-strongly named assembly fro...

--
You received this message because you are subscribed to the Google Groups "Castle Project Users"...

Reply all
Reply to author
Forward
0 new messages