473,378 Members | 1,321 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,378 software developers and data experts.

Debugging designer bug

i have an app that uses a lot of bitmaps, associated with various classes
etc on the gui. Everytime i open then designer i am getting a "object
reference not set to an instance of an object" msg box. i know what it measn
but have no clue where it is comming from.
how can i debug this?
Nov 17 '05 #1
1 2047
"Raj Chudasama" <raj@asteriasgi_spamkiller.com> wrote in message news:O0*************@TK2MSFTNGP15.phx.gbl...
i have an app that uses a lot of bitmaps, associated with various classes etc on the gui. Everytime i open then designer i am
getting a "object reference not set to an instance of an object" msg box. i know what it measn but have no clue where it is comming
from.
how can i debug this?


With your original project open in Visual Studio .NET, switch to any tab
(for instance, a ".cs" source file tab) that's not the Designer panel.

Then open a second instance of Visual Studio .NET (so you have two
IDEs open at once). Load any debug project into this instance (for
example, your project for the designer code that's throwing the
exception) so you'll have source code when you enter the debugger.

In the second instance, choose to Debug | Attach to Process... and
hook yourself to the first "devenv.exe" (you can tell them apart by
the title bar caption). Then under Debug choose Exceptions ... and
turn on "Break into the debugger" for the System.NRE (and any
others you may be interested in). The dialog should show a red
globe with an X through it, when breaking on that Exception has
been enabled.

Task-switch back into your first instance of Visual Studio .NET and
change tabs to the Designer panel where you are receiving this "Object
not set to an instance of an object." error. If all worked correctly,
then you should be swapped back into the second instance with the
debugger on the line of source code throwing the NRE (provided
you have that debug builder of the designer and source code matching
what's loaded into the first instance -- you have to make sure your
versions/builds are the same for this to work.)

If the exception came from within Visual Studio .NET, you may only
be able to get "Disassembly," in which case you usually want to F5
to let the designer run further. It may rethrow types of Exceptions
different from the original type that caused the fault (for this reason,
it's usually a good practice to turn on "Break into the Debugger" on
all CLR Exceptions, although some first-chance exceptions may be
a matter of routine and no cause for alarm) that will eventually bubble
up to your Designer's code.
Derek Harmon
Nov 17 '05 #2

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

Similar topics

1
by: broebel | last post by:
I'm just wondering, people tell me that helping to debug someone elses program is a really good way to learn to understand the language it's programmed in. My question is: from wich point of...
6
by: Ashley Lloyd | last post by:
What do people generally use to debug their Python programs? I haven't seen anything out there that walks through the code, but perhaps I'm looking in the wrong places? TIA Ashley ...
0
by: Severian | last post by:
Hi, I have a custom DTS task as a DLL written using .NET platform. I was able to debug a standard custom task writen in natively in C++ and COM, but somehow I got errors when dragging such task in...
3
by: ally | last post by:
When I debug the project Icant into class.How can I do this??? Tahnks
2
by: Bob | last post by:
What's the best way to debug an problem that only comes up in the forms designer? I get a compile error in the task list, but it's a not-so-helpful 'Object reference not set to instance of an...
6
by: ?scar Martins | last post by:
Hi When I'm debugging and somewhere in the code I have a breakpoint, many times when the code after breakpoint finishes and the app returns I can do nothing within in it(it's like freeze)... The...
1
by: Robin Tucker | last post by:
Hi, I have a problem with my code (somewhere in the InitialiseComponent) preventing any of my controls being visible in form design mode, although everything is ok at runtime. No errors are...
0
by: krystian | last post by:
Hello, I've been following the previous thread "Windows Service Starts and Immediately Stops" and I have a similar problem. I've been trying to get started on a windows service and have...
0
by: =?Utf-8?B?Y2luZHk=?= | last post by:
I have a web project in NET2.0/VS 2005 C# this question is not about CSS instead why using asp.net 2.0 csharp when I am debugging, the styles defined in the Style Sheets are not appearing on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.