473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Tracking exception source during layout of user defined controls

Hi,

I have a C# user defined control that I want to place in a form. When I
drag it into the form it generates an exception (it works okay if I add the
control manually in the code, compile and then run it ... i.e. it doesn't
generate an exception). I'd really like to use debugging tools (rather than
a time-consuming brute force approach) to discover where the exception is
occuring when I drag the control into the form, but there does not appear to
be any debugging support of this kind in VS .Net to allow this.

Any suggestions as to how to find exceptions that occur during layout but
not at runtime?

Thanks in advance.

-&&

Nov 16 '05 #1
2 1797
Your most likely exceptions are not having a default constructor, in some
cases dragging the control from the same project it is defined in, or you
are accessing certain properties that aren't available at design-time. A great
example is that invoke calls can't be made at design time (which I think
means you Handle isn't available).

--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"andand" <an****@discussions.microsoft.com> wrote in message
news:04**********************************@microsof t.com...
Hi,

I have a C# user defined control that I want to place in a form. When I
drag it into the form it generates an exception (it works okay if I add the
control manually in the code, compile and then run it ... i.e. it doesn't
generate an exception). I'd really like to use debugging tools (rather than
a time-consuming brute force approach) to discover where the exception is
occuring when I drag the control into the form, but there does not appear to
be any debugging support of this kind in VS .Net to allow this.

Any suggestions as to how to find exceptions that occur during layout but
not at runtime?

Thanks in advance.

-&&

Nov 16 '05 #2
After you build your control, start another instance of Visual Studio
opening a test project using your control. Then attach the debugger to that
second instance of Visual Studio using the Debug/Processes menu item. If you
do this often, you may wish to change the debug start up type of your
project to Program, select the devenv.exe executable as the startup program,
and pass in the command line the path of a test project.

You don't need a separate test project; you can actually load the exact same
project in a new VS instance.

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

"andand" <an****@discussions.microsoft.com> wrote in message
news:04**********************************@microsof t.com...
Hi,

I have a C# user defined control that I want to place in a form. When I
drag it into the form it generates an exception (it works okay if I add
the
control manually in the code, compile and then run it ... i.e. it doesn't
generate an exception). I'd really like to use debugging tools (rather
than
a time-consuming brute force approach) to discover where the exception is
occuring when I drag the control into the form, but there does not appear
to
be any debugging support of this kind in VS .Net to allow this.

Any suggestions as to how to find exceptions that occur during layout but
not at runtime?

Thanks in advance.

-&&

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. ...
3
by: I am Sam | last post by:
I keep getting the following error message when I try to iterate through a CheckBoxList control: Object reference not set to an instance of an object. Description: An unhandled exception...
15
by: David | last post by:
Hi, I have built a web application that will be a very high profile application. We had tested it, demonstrated it and shown that it all works. On a dress rehearsal run through, it failed...
7
by: Chuck Hartman | last post by:
I have a Windows service that requests web pages from a site using an HttpWebRequest object. When I try to request a page from an ASP.NET 2 site, I get a WebException with message "The remote...
20
by: Alan Silver | last post by:
Hello, In classic ASP, I used to use two include files on each page, one before and one after the main content, to provide a consistent layout across a web site. That way I could just change the...
1
by: Robert | last post by:
I have a large web site converted from 1.1 to 2.0 and in VS 2005, the IDE complains that in the ASPX file (html source): Error 1 Element 'stylesheet' is not a known element. This can...
0
by: Jarod | last post by:
I got following expeption: Always when I try to update gridView using detailsView on the SECOND time. So I made 1 update, and I try to make another one and than boom... I don't add any controls...
1
by: Jess Chadwick | last post by:
I am attempting to use the Enterprise Library (Jan 2006) Cryptography block to encrypt a credit card number in my ASP.NET 2.0 Commerce Server application. Everything is configured correctly, as...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.