Topics: Developer Forum, User Forum
Jun 14, 2007 at 1:43 PM
I saw that you have a work item for remoting: 9704. I wasn't sure whether to post this as a comment to the work item or to the forum.

I tried to use the Custom Class approach over remoting. Everything works fine if there are no validation errors. If there is a validation error, the following error is generated:
Type 'ValidationFramework.ValidationResult' in Assembly 'ValidationFramework, Version=, Culture=neutral, PublicKeyToken=2f07bd240683f08a' is not marked as serializable.

I added the Serializable attribute to the ValidationResult class and tried again. I then received a different error message:
Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.

I didn't dig any deeper than this. Something about the internal state of the PropertyValidationManager is causing the issue when there are validation errors. In my case, I don't need to save the state of the PropertyValidationManager. The error messages are being aggregated up to an ErrorMessages collection in my class, I changed the scope of the PropertyValidationManager to within my Validate method instead of a private class member. This is a workable solution for me since I am just using the Attribute Validation features of the framework.

I'm using the 23091 build.