How do you debug a Designer Error from Inherited forms

  • Thread starter Mike in Paradise
  • Start date
M

Mike in Paradise

I am getting an error in the Designer when trying inherit
a form.

Value cannot be null: Parameter Name dataSource

now I do not use the Name dataSource in any of the
inherited code so I am assuming that this is in the VS
Designer code somewhere.

The original base form comes up in the designer just fine.

If I Ignore the designer and compile the new Inherited
form it compiles and runs just fine.

Is there a way of debugging what the designer is doing
when it attempts to load the inherited form so I can see
what is giving the designer grief.
 
M

mklapp

Hello,
dataSource is a property used to bind data to controls
(I bet you already know that).
Find all the controls/windows that have a datasource
property.
Also, check the windows generated code at the top of
the Form Code.

I'm not sure how you try to inherit or where the error
appears that you report.

I know it isn't much.

m klapp
 
I

Iulian Ionescu

That is not easy but it it doable:

In the Designer class Project, access the Project's
Property dialog box by right-clicking on the Project name
in the Solution Explorer and choosing Properties.
Go to the Debugging settings in the Configurations
Properties folder and choose the Debug Mode as Program.
Set the Start Application as devenv.exe (you may need to
include the path to the file - this is the Visual
Studio .NET IDE EXE file...)
Set a breakpoint in your Designer class at an appropriate
location...
Hit F5 to start debugging, this will open up another
instance of VS.NET
Create a new windows forms application and add to the
References folder the assembly that contains the Designer
class.
Drag and drop your custom control from the Toolbox onto
the Design tab - you should be taken to the breakpoint in
your Designer class.

I never tried this completely but it makes sense.
Basically you use another instance of devenv to debug the
entire devenv that runs your application, including the
designer...
 
M

Mike in Paradise

Well I after 4 hours of digging through code
(unfortunately this code initializes with a DataHandler
and ImageHander, I found the line of code that wouldn't
work with the designer.)

The issue to me is that the designer should have given at
least come class and method info so you could figure it
out easily.

I found this weblink

http://www.codeproject.com/csharp/blankpageindesigner.asp

on doing this but I cannot get this trigger properly
within my solution.

Thanks for the replies...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top