PostSharp bug/issue with delegate { } assignments in v.

bitquakeengine's Avatar


01 Sep, 2017 02:40 PM

I have a pretty weird problem with PostSharp and the .pdb generation, which I need to debug my program.

After I installed PostSharp into my new Project, debugging wasnt possible anymore, because of the missing pdb file. I tried to create a new Project to test PostSharp and everything worked well.
So I removed all my source files and started to add one after each other and built the project to investigate which class may cause the issue. After I found the first class which caused the.problem, I checked each line of code and came up with this simplification of a class, which reproduces my issue:

    public class ThreadHelper
        public delegate void ExecuteAction();
        private static ExecuteAction[] perfActions;
        public static void Init()
            perfActions[0] = delegate { };

        private static void RunPerf()
            perfActions[0] = delegate { };

        private static void RunGeneric()
            perfActions[0] = delegate { };

This behavior is present in any class, where I place these 3 static methods.
If I remove any of these "perfActions[0] = delegate { };" lines, the .pdb file was generated. So if there are more than 2 of these lines >> in separated methods << it fails to generate.

Is this a bug or can I fix it somehow? I think there are much more cases of this in my project because I also use the "delegate{ }" as a default event initializer.

  1. Support Staff 1 Posted by PostSharp Techn... on 01 Sep, 2017 05:33 PM

    PostSharp Technologies's Avatar


    thank you for reporting the issue. We are able to reproduce the error with C#5/VS2013. PostSharp processes this code well when using C#7/VS2017.

    We're closing the ticket for now as the bug has been internally filed as issue #15431. We will contact you as soon as the bug fix has been released.

    For more details on our support policies and prioritization of bug fixes, please visit


  2. PostSharp Technologies closed this discussion on 01 Sep, 2017 05:33 PM.

  3. PostSharp Technologies re-opened this discussion on 19 Sep, 2017 12:50 PM

  4. Support Staff 2 Posted by PostSharp Techn... on 19 Sep, 2017 12:50 PM

    PostSharp Technologies's Avatar


    the bug #15431 has been fixed in the current release of PostSharp 5.0.33.
    Should you need further help with this issue, don't hesitate to re-open this discussion.

    Best regards,

  5. PostSharp Technologies closed this discussion on 19 Sep, 2017 12:50 PM.

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

Keyboard shortcuts


? 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