Vibrant discussion about CSLA .NET and using the framework to build great business applications.

VSTO and CSLA 2.0 Error

rated by 0 users
This post has 16 Replies | 1 Follower

Top 10 Contributor
Posts 9,362
Unfortunately that won't help if my suspicion is correct. The reason being that you can't handle the event in the main AppDomain, only in the sub-AppDomain where your code runs. The exception would be happening in the main AppDomain when it tries to deserialized the principal there...

This sounds reasonable to me.  Unfortunatly, I don't think VSTO offers anything so clear.  The work around could be to check that the assembly resolve event is handled each time your code runs.. perhaps not nice, but it should work.


Not Ranked
Posts 1
borota replied on Thu, Mar 6 2008 11:13 AM

I was having exactly the same problem with VSTO 2.0. Resetting the Principal to be a GenericPrincipal works. In the form's Close event I'd reset the Principal to be GenericPrincipal, and right after the ShowDialog call, set it back to CSLA principal.

I discovered a better solution though. Just drop a BackgroundWorker control on your form while in design mode. You don't necessarily need to do anything with it, just having it, makes the serialization exception go away.

I don't know why this takes care of the issue, if you do, please share.

Page 2 of 2 (17 items) < Previous 1 2 | RSS

Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems