NotifyPropertyChanged Aspect in UserControl

erich.wessely's Avatar

erich.wessely

31 May, 2018 02:05 PM

Hi,
when using the NotifyPropertyChanged aspect in a user Control, the designer crashes when opening a form containing the usercontrol. During runtime everything is ok.
When implementing INotifyChildPropertyChanged manually in the user Control everything works fine also in designtime.
I'm using the actual 5.0.51 version of postsharp under VS2017 in a c# Project.
Do you have any suggestions?

  1. Support Staff 1 Posted by PostSharp Techn... on 01 Jun, 2018 07:35 AM

    PostSharp Technologies's Avatar

    Hello,

    do you mean Windows Forms app or WPF app?

    Would it be possible to send us a project that reproduces the behavior?

    Thanks.

    All the best,
    Daniel

  2. 2 Posted by erich.wessely on 01 Jun, 2018 10:04 AM

    erich.wessely's Avatar

    Hello,
    sure - pls find attached a very simple sample. I've the Problem with Windows Forms.
    if you remove the [NotifyPropertyChanged] in the usercontrol you will be able to open Form1 in development designer, otherwise the designer crashes…

    br
    Erich

  3. Support Staff 3 Posted by PostSharp Techn... on 05 Jun, 2018 12:55 PM

    PostSharp Technologies's Avatar

    Hello,

    Thank you for sending us the reproduction project. We can see the error when trying to open the form designer in Visual Studio. However, after we build the project the form designer works fine. This is the expected behavior of the forms designer when the control and the form belong to the same project. Usually the designer can use a temporary compiled version of the control, but external references, such as PostSharp, can easily break it.

    Please confirm whether building the project solves the form designer issue for you.

    Best regards,
    Alex

  4. 4 Posted by erich.wessely on 06 Jun, 2018 06:30 AM

    erich.wessely's Avatar

    Hi Alex,
    sorry, but I cannot confirm. Also after recompiling (which you always have to do after modification of an UC) the designer crashes.
    Attached find a screenshot.

    br
    Erich

  5. Support Staff 5 Posted by PostSharp Techn... on 07 Jun, 2018 03:38 PM

    PostSharp Technologies's Avatar

    Hello,

    We have found one possible cause of this issue - incompatible versions of PostSharp Tools extension in Visual Studio and PostSharp NuGet package in the project. Could you please install the version of PostSharp Tools VS extension that matches the version of PostSharp NuGet package in your project?

    -alex

  6. 6 Posted by erich.wessely on 08 Jun, 2018 11:09 AM

    erich.wessely's Avatar

    Hello Alex,
    I updated the installed Tools in VS2017 to 5.0.51 - they are the same Version now as the nuget packages.
    Unfortunatelly this did not solve the problem. Maybe you have another idea?

    br
    Erich

  7. Support Staff 7 Posted by PostSharp Techn... on 11 Jun, 2018 08:18 AM

    PostSharp Technologies's Avatar

    Hello,

    which version of Visual Studio 2017 are you using? I'm not able to reproduce the behavior on 15.7.3 after rebuild and closing/reopening the control.

    Best,
    Daniel

  8. 8 Posted by erich.wessely on 11 Jun, 2018 08:24 AM

    erich.wessely's Avatar

    Hi Daniel,
    I'm on 15.6.6.
    I'll update and give you Feedback as soon as the update completed

  9. 9 Posted by erich.wessely on 11 Jun, 2018 08:46 AM

    erich.wessely's Avatar

    Hi Daniel,
    :-) VS 15.7.3 did it !!! Thank you for your support

    br
    Erich

  10. erich.wessely closed this discussion on 11 Jun, 2018 08:46 AM.

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