OnExceptionAspect breaks WinForms designer
4 posts • Page 1 of 1
OnExceptionAspect breaks WinForms designer
Hello,
I have a WinForms project, with a separate control library, both of which reference a common DLL with an OnExceptionAspect handler.
The windows form contains a user control from the control library. Once I try to open the form in the Designer, this error is shown on the Designer surface:
|
Unable to cast object of type 'TestAspect1Library.TraceAttribute' to type
'TestAspect1Library.TraceAttribute'. |
|
|
at
~PostSharp~Laos~Implementation..cctor() |
If I remove the PostSharp processing (on both the Form and the UserControl) and recompile, it works correctly.
Alan Singfield
- alansingfield
- Posts: 3
- Joined: Sat Jan 12, 2008 4:55 pm
- Full Name: Alan Singfield
Re: OnExceptionAspect breaks WinForms designer
Example project at:
[url=http://www.didsburysoftware.co.uk/TestAspect1.zip]http://www.didsburysoftware.co.uk/TestAspect1.zip[/url]
Alan Singfield
- alansingfield
- Posts: 3
- Joined: Sat Jan 12, 2008 4:55 pm
- Full Name: Alan Singfield
Re: OnExceptionAspect breaks WinForms designer
Generally, the error "Unable to cast object of type X to type X." means that two versions of the same assembly have been loaded in the application domain.
Does this help?
Does this help?
Gael Fraiteur, project leader
got good support? consider donating to the project.
got good support? consider donating to the project.
- gfraiteur
- Site Admin
- Posts: 608
- Joined: Tue Dec 18, 2007 3:09 pm
- Full Name: Gael Fraiteur
- Company: postsharp.org
Re: OnExceptionAspect breaks WinForms designer
That would figure; as I have both a WinForms EXE and separate UserControl DLL both referencing the same project. I'll try using a strong name and let you know if that helps.
Alan Singfield
- alansingfield
- Posts: 3
- Joined: Sat Jan 12, 2008 4:55 pm
- Full Name: Alan Singfield
4 posts • Page 1 of 1