`
mlzboy
  • 浏览: 702222 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

使用Remoting实现的aop,无法改变返回值吗?

AOP 
阅读更多
using System;
using System.Runtime.Remoting.Messaging;
using System.Reflection;
namespace AspectTest
{
    
/**//// <summary>
    
/// Aspect 的摘要说明。
    
/// </summary>

    public class Aspect:Langzhi.Aspect.IAspect
    
{
        
public Aspect()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
        }

        
IAspect 成员#region IAspect 成员

        
public void PostProcess(System.Runtime.Remoting.Messaging.IMessage msg)
        
{
            IMethodReturnMessage call
=msg as IMethodReturnMessage;
            call.ReturnValue=false
;

        }


        
public void PreProcess(System.Runtime.Remoting.Messaging.IMessage msg)
        
{
            
// TODO:  添加 Aspect.PreProcess 实现
        }


        
#endregion

    }

}
使用如上的方法,报错,说是D:\WWWROOT\AspectTest\Aspect.cs(22): 无法对属性或索引器“System.Runtime.Remoting.Messaging.IMethodReturnMessage.ReturnValue”赋值 -- 它是只读的
肯请大家有没有解决的办法啊?
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics