我正在尝试从特定项目的配置文件(* .psproj文件)中排除类或方法。但它不排除,出了什么问题。请指正。请找到psproj配置文件的附件。我使用的是postharp 4.3.23和3.1.46的两个版本,但使用相同的psproj结构。
*.psproj
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.postsharp.org/1.0/configuration" xmlns:d="clr-namespace:LCLogger;assembly:LCLogger" >
<Multicast>
<d:TraceLog AttributeTargetElements="Method"
AttributeTargetTypeAttributes="Public|Internal|Private|UserGenerated"
AttributeTargetMemberAttributes="Public|Internal|Private|UserGenerated"
AttributeTargetMembers="*"> <!--can use regex: for TargetAssemblies and TargetMembers -->
</d:TraceLog>
<d:TraceLog AttributeExclude="True"
AttributeTargetMembers="regex:get_.*|set_.*">
</d:TraceLog>
<!-- Exclude all methods of class -->
<d:TraceLog AttributeExclude="True"
AttributeTargetElements="Method"
AttributeTargetTypeAttributes="regex:SomeClass1|SomeClass2"
AttributeTargetMembers="*">
</d:TraceLog>
<!-- Exclude specific methods of class -->
<d:TraceLog AttributeExclude="True"
AttributeTargetElements="Method"
AttributeTargetTypeAttributes="SomeClass"
AttributeTargetMembers="regex:SomeMethod">
</d:TraceLog>
</Multicast>