Designer Exception when using WinForm ValidationProvider

Topics: Validation Application Block
Jan 27, 2011 at 12:51 PM

Dear all,

I am using the WinForm ValidationProvider to integrate business object validation in the User interface. Everything works fine at runtime but in design mode i get the exception below when i move between different tabs in the tab control. The exception only happen in Forms with a DataGridView eventhough i have not attached anything to the DataGridView.

Exception

The control Sytem.Windows.Forms.TabControl has thrown an unhandled exception in the designer and has been disabled.

Unable to cast object of type 'Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSyntheticConfigSettings' to type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider'.

Environment

Operating system : windows 7

Programming Environment : Visual studio 2010 Professional

EntLib Version : 5

 

Best Regards

Jan 28, 2011 at 5:49 AM

Hi,

I'm unable to reproduce your scenario in a simple Winform project with ValidationProvider and a DataGridView. Can you send us a sample repro project on this.

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

 

Jan 28, 2011 at 3:36 PM

Hi Gino,

I have sent you a sample application with the error.

 

Best Regards

Jan 31, 2011 at 1:53 AM
Edited Jan 31, 2011 at 2:05 AM

The repro you sent gives a different design time error due to the absence of the entities you associate with your validation providers.  I'm trying to add the necessary classes and properties required but could you also send a complete repro?  So I could get right on to the issue. 

 

Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jan 31, 2011 at 4:21 PM

Hi,

I have emailed the updated project to you.

Best Regards

 

Feb 1, 2011 at 3:06 AM

Hi,

I was able to get the designer exception using the sample you've sent. But the exception raised is different this time -

" The control Sytem.Windows.Forms.TabControl has thrown an unhandled exception in the designer and has been disabled. Exception: Could not load type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.EnterpriseLibraryContainer' from assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'."

This is really weird since I don't know why it's still looking for the 4.1 version given that we're already using 5. Also, I was not able to confirm if this is something that only conflicts between the validator control and the reference entlib assemblies (Validator control entlib version is 4.1 while referenced assembly is 5) since when I tried this, this doesn't throw the said exception.

Anyway, removing and re-adding the validator again seems to remove the designer exception raised from my end. Could you check from your end if this will also work for you.

Gino Terrado
Global Technologies and Solutions
Avanade, Inc.
entlib.support@avanade.com

Feb 1, 2011 at 11:18 AM

Hi

I have tried your suggestion and it has resolved the proplem.

 

Thanks for your help.

 

Best regards.