473,473 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How can I resolve a VS2008 designer error


VS designer has started to complain about the following errors :

Object reference not set to an instance of an object.
Instances of this error (2)

and

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Instances of this error (12)

1. Hide Call Stack

at System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializePropertyAssignStatement( IDesignerSerializationManager
manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeAssignStatement(IDesigne rSerializationManager
manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeStatement(IDesignerSeria lizationManager manager,
CodeStatement statement)


It has been working fine for months. I haven't even changed the code in this module. And, the code runs fine when I just run the
code.

Any idea how to get rid of this problem would be welcome. They don't even bother to indicate what field there is a problem with or
where the problem happened in the code - at least as far as I can see.

Thanks,
Steve
Aug 20 '08 #1
3 2242
Please post some of your code so we can see what's happening.
Try to step through your code (set a breakpoint at run time and then
press F11 to go forward). Analyze each line, and see where it gives
the exception. That will really help find the problem.

I don't exactly remember what the first exception means (need to get
some sleep lol) but it'll be logical once there is some code for
dissecting.

Sorry, could you also explain what you mean by "And, the code runs
fine when I just run the code. "???

On Aug 20, 2:24*pm, steve <s_j_b...@yahoo.comwrote:
VS designer has started to complain about the following errors :

Object reference not set to an instance of an object.
Instances of this error (2)

and

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
Instances of this error (12)

1. * * * * * * *Hide Call Stack

at System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializePropertyAssignStatement( IDesignerSerializationManager
manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeAssignStatement(IDesigne rSerializationManager
manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeStatement(IDesignerSeria lizationManager manager,
CodeStatement statement)

It has been working fine for months. I haven't even changed the code in this module. And, the code runs fine when I just run the
code.

Any idea how to get rid of this problem would be welcome. They don't evenbother to indicate what field there is a problem with or
where the problem happened in the code - at least as far as I can see.

Thanks,
Steve
Aug 21 '08 #2
Steve, changes made outside the IDE can 'confuse' the designer. I would try
two things. I would comment out my initialization code and leave nothing but
InitializeComponent() in the form's constructor, and rebuild. If this did
not help, I would take a look at the .Designer.cs code and try isolating
code that may cause the problem by commenting out sections. This requires
understanding what the code does, so you know where to cut. Of course, I'd
backup the file before making any changes in the IDE-generated code. I get
Designer errors in my projects once in a while, often enough to get used to
it.

Michael

"steve" <s_******@yahoo.comwrote in message
news:4f********************************@4ax.com...
>
VS designer has started to complain about the following errors :

Object reference not set to an instance of an object.
Instances of this error (2)

and

Index was out of range. Must be non-negative and less than the size of the
collection. Parameter name: index
Instances of this error (12)

1. Hide Call Stack

at System.ComponentModel.ReflectPropertyDescriptor.Se tValue(Object
component, Object value)
at
System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializePropertyAssignStatement( IDesignerSerializationManager
manager, CodeAssignStatement statement, CodePropertyReferenceExpression
propertyReferenceEx, Boolean reportError)
at
System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeAssignStatement(IDesigne rSerializationManager
manager, CodeAssignStatement statement)
at
System.ComponentModel.Design.Serialization.CodeDom SerializerBase.DeserializeStatement(IDesignerSeria lizationManager
manager,
CodeStatement statement)


It has been working fine for months. I haven't even changed the code in
this module. And, the code runs fine when I just run the
code.

Any idea how to get rid of this problem would be welcome. They don't even
bother to indicate what field there is a problem with or
where the problem happened in the code - at least as far as I can see.

Thanks,
Steve
Aug 21 '08 #3

Thanks for the input.

I eventually found the problem. The designer was instantiating some classes which had properties that didn't check for null values
on some properties. The values would not normally have been null it was just that the designer calls the default constructor which
doesn't get called in the normal running of the program.
Steve
Aug 21 '08 #4

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

Similar topics

1
by: Alex Zhitlenok | last post by:
Hi, My question is how to resolve in C# ambiguous overloaded operators? Let say, I have two unrelated classes A and B, each one implements overloaded operator + with the first parameter of type...
20
by: Iouri | last post by:
Hi everybody, We are currently using VS2003 and now we are in the porcess of upgrading to the next Visual Studio version. Does somebody have a real life experience with VS2008? My boss wants to...
3
by: GaryDean | last post by:
Is there any possible downside of completely replacing VS2005 with VS2008 willy-nilly? Shouldn't it work with all of my 2.0 projects and websites? (I have MSDN vs2008 DVD (disk 4400)) ...
2
by: Academia | last post by:
I have vs2005 installed on the System disk and vs2008 installed on a different disk. I want to remove VS2005. I read one time about some problem with uninstalling vs2005 after vs2008 is...
16
by: Harry Simpson | last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into properties and select to use IIS instead of the personal web server. Then I run in debug mode and it says I have to set...
1
by: andrew smith | last post by:
Problem is with the designer... // opens in designer // (has reason not to (undefined)) public class BaseForm<T>: Form { } // doesn't open in design (it should) public class...
16
by: Charles Law | last post by:
I have to take this personally now. Tooltips have been flakey since the dawn of .NET, but to still have to put up with a disappearing tooltip in VS 2008 is getting beyond a joke. Tooltips have...
3
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, There is a fatal error while installing VS2008 SP1 on Vista 64bit Business edition. The last line of error log is Installation failed with error code: (0x80070643) I tried to...
4
by: | last post by:
Hi, After installing SP1 for VS2008 and SP1 for .NET 3.5 we get the following warning in a VS2005 build: error CS0618: Warning as Error: 'System.Windows.UIElement.BitmapEffect' is obsolete:...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.