Allow Warning Suppression and Escalation from PostSharp.config

Jason DiOrio's Avatar

Jason DiOrio

19 Apr, 2018 09:01 PM

It would appear that the PostSharpDisabledMessages and PostSharpEscalatedMessages properties supported in MSBuild-based configuration are not honored if they're specified in a PostSharp.config file. We use a single PostSharp.config file at the root of a source control repository containing many solutions and it would be much preferred to place these once globally rather than adding custom targets to every solution or manually adding xml nodes to every project. I had experimented with this with hopes, but the documentation at http://doc.postsharp.net/ignoring-warnings did seem to correctly indicate that it was exclusive to MSBuild configuration. We probably won't upgrade just for this improvement, but if it isn't overly difficult, it might be nice to support.

Thanks,
-Jason

  1. Support Staff 1 Posted by PostSharp Techn... on 20 Apr, 2018 02:51 PM

    PostSharp Technologies's Avatar

    Hello,

    you can use PostSharp.Custom.targets in the solution root for this purpose. PostSharp searches for MSBuild project file with this name in parent repositories and imports any such existing file (bottom first).

    Hope it helps.

    Best regards,
    Daniel

  2. 2 Posted by Jason DiOrio on 20 Apr, 2018 02:54 PM

    Jason DiOrio's Avatar

    Ah, so it will search for this file by path, whether or not it's added as a solution file? That will be sufficient, if so, we just already had a PostSharp.config file and I wanted to avoid having to modify each individual solution file.

    Thanks kindly,
    -Jason

  3. Support Staff 3 Posted by PostSharp Techn... on 20 Apr, 2018 03:00 PM

    PostSharp Technologies's Avatar

    Hello,

    no, you don't have to modify any solution file or project file. Just have it for instance in the repository root.

    These message-related properties work on a lower level than PostSharp project configuration files, so it's unlikely we will ever add an option to use it from the project file.

    Kind regards,
    Daniel

  4. 4 Posted by Jason DiOrio on 20 Apr, 2018 03:04 PM

    Jason DiOrio's Avatar

    That worked perfectly, thanks. Since this is just as usable as what I proposed I don't see a need to go through the effort of moving it now that I know I don't need to modify solution files to get the desired result. Thanks very much :)

  5. PostSharp Technologies closed this discussion on 23 Apr, 2018 03:57 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac