.NET Framework4.0上でQuillContainer#GetComponentで
AOP指定ありのクラスのインスタンスを取得しようとするとエラーが発生する。
・.NET Framework3.5 SP1でコンパイルした場合は正常に動作する。
(QuillContainer#GetComponentからインスタンスを取得できる)
・Castle.DynamicProxy内で
System.Reflection.AmbiguousMatchException
(Message=あいまいな一致が見つかりました。)
が発生している。
・Castle.DynamicProxyの最新版(beta)は.NET4.0に対応している(らしい)が
IFが変わっているためそのまま適用するとSeasar.DynamicProxyで
コンパイルエラーが発生する。
●Castle.DynamicProxyの最新版(beta)について
http://kozmic.pl/archive/2010/07/05/castle-windsor-2.5hellip-the-final-countdown-ndash-beta-1-released.aspx
●エラー発生時のStackTrace
Seasar.Quill.Exception.QuillApplicationException はハンドルされませんでした。
Message=[EQLL0037]プロキシオブジェクト(Sample)の生成に失敗しました。コンストラクタ内の処理、アクセス修飾子、インターセプターを設定しているメソッドがインターフェースor virtualになっているか、Castle.DynamicProxy.dllがSeasar.Quill.dllと同じ場所にあるか等をご確認下さい。
Source=Seasar.Quill
MessageCode=EQLL0037
SimpleMessage=プロキシオブジェクト(Sample)の生成に失敗しました。コンストラクタ内の処理、アクセス修飾子、インターセプターを設定しているメソッドがインターフェースor virtualになっているか、Castle.DynamicProxy.dllがSeasar.Quill.dllと同じ場所にあるか等をご確認下さい。
StackTrace:
場所 Seasar.Quill.QuillComponent.CreateProxyObject(Type componentType, Type receiptType, IAspect[] aspects)
場所 Seasar.Quill.QuillComponent..ctor(Type componentType, Type receiptType, IAspect[] aspects)
場所 Seasar.Quill.QuillContainer.GetComponent(Type type, Type implType)
場所 Seasar.Quill.QuillContainer.GetComponent(Type type)
場所 Seasar.Quill.Util.ComponentUtil.GetComponent(QuillContainer container, Type componentType)
場所 WpfApplication1.MainWindow.button1_Click(Object sender, RoutedEventArgs e) 場所 C:\Users\koyak\documents\visual studio 2010\Projects\WpfApplication1\WpfApplication1\MainWindow.xaml.cs:行 32
場所 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
場所 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
場所 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
場所 System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
場所 System.Windows.Controls.Primitives.ButtonBase.OnClick()
場所 System.Windows.Controls.Button.OnClick()
場所 System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
場所 System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
場所 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
場所 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
場所 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
場所 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
場所 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
場所 System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
場所 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
場所 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
場所 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
場所 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
場所 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
場所 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
場所 System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
場所 System.Windows.Input.InputManager.ProcessStagingArea()
場所 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
場所 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
場所 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
場所 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
場所 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
場所 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
場所 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
場所 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
場所 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
場所 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
場所 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
場所 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
場所 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
場所 System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
場所 System.Windows.Threading.Dispatcher.Run()
場所 System.Windows.Application.RunDispatcher(Object ignore)
場所 System.Windows.Application.RunInternal(Window window)
場所 System.Windows.Application.Run(Window window)
場所 System.Windows.Application.Run()
場所 WpfApplication1.App.Main() 場所 C:\Users\koyak\documents\visual studio 2010\Projects\WpfApplication1\WpfApplication1\obj\x86\Debug\App.g.cs:行 0
場所 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
場所 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
場所 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
場所 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
場所 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
場所 System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Reflection.AmbiguousMatchException
Message=あいまいな一致が見つかりました。
Source=mscorlib
StackTrace:
場所 System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
場所 System.Type.GetMethod(String name)
場所 Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.LockBlockExpression.Emit(IEasyMember member, ILGenerator gen)
場所 Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.ExpressionStatement.Emit(IEasyMember member, ILGenerator gen)
場所 Castle.DynamicProxy.Builder.CodeBuilder.AbstractCodeBuilder.Generate(IEasyMember member, ILGenerator il)
場所 Castle.DynamicProxy.Builder.CodeBuilder.EasyMethod.Generate()
場所 Castle.DynamicProxy.Builder.CodeBuilder.AbstractEasyType.EnsureBuildersAreInAValidState()
場所 Castle.DynamicProxy.Builder.CodeBuilder.AbstractEasyType.BuildType()
場所 Castle.DynamicProxy.Builder.CodeGenerators.BaseCodeGenerator.CreateType()
場所 Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass, Type[] interfaces)
場所 Castle.DynamicProxy.Builder.CodeGenerators.ClassProxyGenerator.GenerateCode(Type baseClass)
場所 Castle.DynamicProxy.Builder.DefaultProxyBuilder.CreateClassProxy(Type theClass)
場所 Seasar.Framework.Aop.Proxy.DynamicAopProxy..ctor(Type type, IAspect[] aspects, Hashtable parameters, Object target)
場所 Seasar.Framework.Aop.Proxy.DynamicAopProxy..ctor(Type type, IAspect[] aspects, Hashtable parameters)
場所 Seasar.Quill.QuillComponent.CreateProxyObject(Type componentType, Type receiptType, IAspect[] aspects)
InnerException: