0

我正在尝试从特定项目的配置文件( *.psproj 文件)中排除类或方法。但也不排除,出了什么问题。请纠正我。请找到 psproj 配置文件的附件。我使用两个版本的 postsharp 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>

4

0 回答 0