C# 装配中的后锐
我有一个postsharp属性,用于处理整个dll中的异常(ddl由其他团队提供)和管理数据库调用。 因此,我们的想法是用postsharp处理异常 这就是属性C# 装配中的后锐,c#,postsharp,C#,Postsharp,我有一个postsharp属性,用于处理整个dll中的异常(ddl由其他团队提供)和管理数据库调用。 因此,我们的想法是用postsharp处理异常 这就是属性 [Serializable] public class MethodConnectionTracking: OnExceptionAspect { bool canceled = false; public override void OnException(MethodExecution
[Serializable]
public class MethodConnectionTracking: OnExceptionAspect
{
bool canceled = false;
public override void OnException(MethodExecutionArgs args)
{
Exception ex = args.Exception;
if (ex != null)
{
--- do things
}
}
}
要使其正常工作并拦截assemblyInfo.cs中名为SPData的项目的所有方法,我有:
[assembly: MethodConnectionTracking(AttributeTargetElements = MulticastTargets.Method)]
这很有效。但我想在其他项目中指定该行
因此,主要项目引用了SPData。因此,在主项目AssemblyInfo.cs文件中,我写道:
[assembly: MethodConnectionTracking(AttributeTargetAssemblies = "SPData", AttributeTargetElements = MulticastTargets.Method)]
但它不起作用
它是否可能做我想做的,我是否遗漏了一些参数
提前谢谢