How to handle exception "Error rendering control" at designMode in Visual Studio?

I have created a custom control which is doing exactly as it should, but for some reason is showing an exception in designmode.

Error rendering control - MyControl
An unhandled exception has occured.
TagPrefix:MyControl could not be set on property 'MyProperty'.

This grey block only appears in DesignMode when using the custom control. All works fine at run time.

The grey block appears when modifying a property of type "List Of" in the property window. But again it does not cripple anything at run time.

I would like to 'handle' this exception, but where is it being generated. I assumed it would be on the render sub of the control, but my attempts have failed. Any insight would be appreciated.
LVL 13
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you do any overloading of constructors or anything like that?  It is tough without seeing the code as to why it might be complaining.  usually it is due to variables that need to be initialized or something like that.
OnthraxAuthor Commented:
Yes as the control is inheriting a basevalidator I need to override/overload various subs.

Posting code is a little tricky as it is weaved into a greater whole. I could try to create a new control and only put in the classes and such that cause the exception.

This will take some time, so I will only do this if you really want to put some time into checking out the code.. Please let me know..

Cheers :)
OnthraxAuthor Commented:
I really need this resolved so I went ahead and ripped everything I could. This is the most basic as I can get it.

I have uploaded the control here:

If you create a new webpage and drag the control onto the page, you will see the [Custom validator] tag.
You can change all properties without any problems except for the properties 'Failure' and 'Success'. If you click on the elypses and press the ADD button, the gray box will appear in visual studio. If you add a few and run the page, source will look like this:

    <cc1:ServerControl1 ID="ServerControl11" runat="server">
            <cc1:Effect Input1="asd" Input2="sdf" Input3="fds" />
            <cc1:Effect Input1="fds" Input2="sdf" Input3="sdf" />
            <cc1:Effect Input1="ss" Input2="dd" Input3="ff" />

And the code will execute fine. The issue only presents itself in visual studio..

Hope you can find the problem. Thanks in advance! :)
OnthraxAuthor Commented:
I have finally figured it out. Cost me over 8 hours, but at least I got it fixed.

Error was caused by the property of type 'List Of' not being readonly.

In case you had already taken a look, thanks for trying. If not, thanks for your attempt.

Cheers :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.