Kumar Manish
Kumar Manish

Reputation: 1

*.psproj not excluding the class or method

I am trying to exclude the class or method from configuration file ( *.psproj file ) for specific project. but it is not excluding, What went wrong. Please correct me. Please find the attachment of psproj config file.I am using two version of postsharp 4.3.23 and 3.1.46 but using same psproj structure.

*.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>

Upvotes: 0

Views: 72

Answers (0)

Related Questions