C# 是否可以使用Spring.Net代理COM接口?

C# 是否可以使用Spring.Net代理COM接口?,c#,com,spring.net,dynamic-proxy,C#,Com,Spring.net,Dynamic Proxy,我正在尝试使用Spring.NET和C#为COM接口创建一个动态代理。我目前正在尝试使用代码,而不是配置文件。 我有类似以下代码: Type comInterfaceType = typeof(ICOMInterface); ProxyFactory proxyFactory = new ProxyFactory(); proxyFactory.AddInterface(comInterfaceType); proxyFactory.GetProxy(); 它在GetProxy()调用时爆炸,

我正在尝试使用Spring.NET和C#为COM接口创建一个动态代理。我目前正在尝试使用代码,而不是配置文件。 我有类似以下代码:

Type comInterfaceType = typeof(ICOMInterface);
ProxyFactory proxyFactory = new ProxyFactory();
proxyFactory.AddInterface(comInterfaceType);
proxyFactory.GetProxy();
它在GetProxy()调用时爆炸,出现以下异常:

System.InvalidOperationException: The property with name ArraySubType can't be found 
    in the type System.Runtime.InteropServices.MarshalAsAttribute, but is present as 
    a named property on the attributeData 
[System.Runtime.InteropServices.MarshalAsAttribute(
    (System.Runtime.InteropServices.UnmanagedType)28, ArraySubType = 0, SizeParamIndex
    = 0, SizeConst = 0, IidParameterIndex = 0, SafeArraySubType = 0)]
难道这根本不可能吗?我仍然在使用Spring.NET 1.1,在更新的版本中(我们很快就会移动到这个版本),这可能吗


更新:经过实验,我在代理Form类时也遇到了同样的错误,参数略有不同(即UnmanagedType 44)。

这似乎是Spring.NET 1.1在为代理方法生成属性时出现错误的结果:。我们有一个测试迁移到最新Spring版本的解决方案,所以我在那里测试了这个。成功了