Windows forms designer crashes when opening form

erich.wessely's Avatar

erich.wessely

14 Nov, 2017 08:09 PM

Hi,
i've the following problem:
On a Windows form in a c# project I use a user control which uses the [Dispatched(true)] aspect. When I try to open the form in design mode I get the following error:

 Cannot find a serializer for type 'PostSharp.Patterns.Threading.DispatchedAttribute+DispatchedMethodAspect'.
 
at PostSharp.Serialization.SerializerProvider.GetSerializer(Type objectType)
at PostSharp.Serialization.SerializationReader.GetObjRef(Int32 instanceId)
at PostSharp.Serialization.SerializationReader.ReadObject(Int32 instanceId, Boolean initializeObject)
at PostSharp.Serialization.SerializationReader.ReadObjRef(Boolean initializeObject)
at PostSharp.Serialization.SerializationReader.ReadValue(SerializationIntrinsicType intrinsicType, Type type, Boolean initializeObject)
at PostSharp.Serialization.SerializationReader.ReadArrayElements(Array array, Type elementType, Int32[] indices, Int32 currentDimention)
at PostSharp.Serialization.SerializationReader.ReadArray(Array array)
at PostSharp.Serialization.SerializationReader.InitializeObject(Int32 instanceId)
at PostSharp.Serialization.SerializationReader.ReadObject(Int32 instanceId, Boolean initializeObject)
at PostSharp.Serialization.SerializationReader.Deserialize()
at PostSharp.Aspects.Serialization.PortableAspectSerializer.Deserialize(Stream stream, IMetadataDispenser metadataDispenser)
at PostSharp.Aspects.Serialization.AspectSerializer.Deserialize(Assembly assembly, String resourceName, IMetadataDispenser metadataDispenser)
at PostSharp.ImplementationDetails_4dc7a54f.<>z__a_5..cctor() in :line 0

when I remove the aspect in the usercontrol everything works fine.

Versions used:
Postsharp 5.0.37 (from nuget)
VS2015 (14.0.25425.01 update 3)

Do you have any idea what I'm doing wrong?

Many thanks for help.

Erich

  1. 1 Posted by erich.wessely on 19 Nov, 2017 10:43 AM

    erich.wessely's Avatar

    Same with 5.0.38....
    any ideas?

  2. erich.wessely closed this discussion on 19 Nov, 2017 10:43 AM.

  3. erich.wessely re-opened this discussion on 19 Nov, 2017 03:01 PM

  4. Support Staff 2 Posted by PostSharp Techn... on 19 Nov, 2017 07:49 PM

    PostSharp Technologies's Avatar

    Hello,

    We have reproduced this issue and filed a bug in our internal tracker (#15636). We will get back you once the bug fix is released.

    -alex

  5. 3 Posted by erich.wessely on 21 Nov, 2017 06:27 PM

    erich.wessely's Avatar

    Hi Alex,
    good to hear that it's reproduceable on your side. Hope you'll fix it soon.
    Many thanks
    Erich

  6. erich.wessely closed this discussion on 21 Nov, 2017 06:27 PM.

  7. PostSharp Technologies re-opened this discussion on 18 Dec, 2017 01:10 PM

  8. Support Staff 4 Posted by PostSharp Techn... on 18 Dec, 2017 01:10 PM

    PostSharp Technologies's Avatar

    Hello,

    After further investigation we have determined that the issue is caused by a change in the threading aspects serialization that we have implemented in 5.0.36. As a result of this change the dispatched aspect serialization pre-5.0.36 is not compatible with the dispatched aspect serialization post-5.0.36.

    The PostSharp VSIX extension depends on the threading library and ships with the PostSharp.Patterns.Threading.dll assembly. This assembly is then loaded into the VisualStudio domain and can conflict with the PostSharp.Patterns.Threading.dll assembly referenced by your project.

    Specifically, the exception is thrown in the WinForms designer when you have different versions of PostSharp Tools and PostSharp.Patterns.Threading NuGet package installed, where one version is < 5.0.36 and another version is >= 5.0.36. The current solution for this issue is to install the latest version of PostSharp Tools and PostSharp NuGet packages.

    -alex

  9. Support Staff 5 Posted by PostSharp Techn... on 18 Jan, 2018 03:50 PM

    PostSharp Technologies's Avatar

    Hello,

    We are going to close this request as we believe we have provided the solution in the last message. Please feel free to reopen the discussion if you need more help.

    Best regards,
    PostSharp Team

  10. PostSharp Technologies closed this discussion on 18 Jan, 2018 03:50 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