By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,383 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,383 IT Pros & Developers. It's quick & easy.

Object Reference not set to an instance of an object

P: n/a
I am getting "Object reference not set to an instance of an object. " when I
attempt to open a C# windows service class in design view, although I was
able to initially create the service and open in design view. This happens
once I restarted Visual Studio adn opened teh solution

Any ideas on how to fix this would be appreciated..

BR
::Ben
Jul 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Do you see the object that it is complaining about.

Dim C as ClassA
C.SomeProperty = 12345 <--- Error: Object reference not set to an instance
of an object.

Dim C as New ClassA
C.SomeProperty = 12345 <--- Happy!

So find out what object it is complaining about and assign it an instance of
the object.

Hope this helps
Chris

"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
I am getting "Object reference not set to an instance of an object. " when
I
attempt to open a C# windows service class in design view, although I was
able to initially create the service and open in design view. This happens
once I restarted Visual Studio adn opened teh solution

Any ideas on how to fix this would be appreciated..

BR
::Ben

Jul 21 '05 #2

P: n/a
Chris

It does not show me the object;
------------start of error
One or more errors encountered while loading the designer.The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes. Clicking on each error will take you to the
line of code that caused it.

Object reference not set to an instance of an object.

Hide
Edit
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.AddToolboxItem(IVsHierarchy
hierarchy, String typeName, Type loadedType, String category, String
referencePath, ToolboxItemFilterAttribute projectFilter,
ToolboxItemFilterAttribute itemFilter)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager.UpdateToolboxItems(Boolean updateRefs, Boolean updateBuild)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager..ctor(AutoToolboxManagerService
ownerService, IServiceProvider provider, IVsHierarchy hierarchy, Boolean&
keepMe)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManager(Object vsHierarchy)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManagerFromHost(IDesig nerHost host)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.OnDesignerLoadComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadCo mplete(EventArgs e)
at
System.ComponentModel.Design.DesignerHost.System.C omponentModel.Design.Serialization.IDesignerLoader Host.EndLoad(String
rootClassName, Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.OnEndLoad(Boolean successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.System.ComponentModel.Design.Serializ ation.IDesignerLoaderService.DependentLoadComplete (Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.BeginLoad(IDesignerLoaderHost host)
at System.ComponentModel.Design.DesignerHost.BeginLoa d(DesignerLoader loader)
---end of error message---
"Chris, Master of All Things Insignifican" wrote:
Do you see the object that it is complaining about.

Dim C as ClassA
C.SomeProperty = 12345 <--- Error: Object reference not set to an instance
of an object.

Dim C as New ClassA
C.SomeProperty = 12345 <--- Happy!

So find out what object it is complaining about and assign it an instance of
the object.

Hope this helps
Chris

"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
I am getting "Object reference not set to an instance of an object. " when
I
attempt to open a C# windows service class in design view, although I was
able to initially create the service and open in design view. This happens
once I restarted Visual Studio adn opened teh solution

Any ideas on how to fix this would be appreciated..

BR
::Ben


Jul 21 '05 #3

P: n/a
Have you modified any code in the section that is usually commented out by
the Windows Designer. I haven't played much with windows services so I
don't remember what the template looks like, but what this is telling you is
that a change was made where the designer usually plays.

Sorry I can't be more helpful.
Chris
"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
Chris

It does not show me the object;
------------start of error
One or more errors encountered while loading the designer.The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes. Clicking on each error will take you to
the
line of code that caused it.

Object reference not set to an instance of an object.

Hide
Edit
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.AddToolboxItem(IVsHierarchy
hierarchy, String typeName, Type loadedType, String category, String
referencePath, ToolboxItemFilterAttribute projectFilter,
ToolboxItemFilterAttribute itemFilter)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager.UpdateToolboxItems(Boolean
updateRefs, Boolean updateBuild)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager..ctor(AutoToolboxManagerService
ownerService, IServiceProvider provider, IVsHierarchy hierarchy, Boolean&
keepMe)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManager(Object
vsHierarchy)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManagerFromHost(IDesig nerHost
host)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.OnDesignerLoadComplete(Object
sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadCo mplete(EventArgs e)
at
System.ComponentModel.Design.DesignerHost.System.C omponentModel.Design.Serialization.IDesignerLoader Host.EndLoad(String
rootClassName, Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.OnEndLoad(Boolean
successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.OnEndLoad(Boolean
successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.System.ComponentModel.Design.Serializ ation.IDesignerLoaderService.DependentLoadComplete (Boolean
successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.BeginLoad(IDesignerLoaderHost
host)
at System.ComponentModel.Design.DesignerHost.BeginLoa d(DesignerLoader
loader)
---end of error message---
"Chris, Master of All Things Insignifican" wrote:
Do you see the object that it is complaining about.

Dim C as ClassA
C.SomeProperty = 12345 <--- Error: Object reference not set to an
instance
of an object.

Dim C as New ClassA
C.SomeProperty = 12345 <--- Happy!

So find out what object it is complaining about and assign it an instance
of
the object.

Hope this helps
Chris

"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
>I am getting "Object reference not set to an instance of an object. "
>when
>I
> attempt to open a C# windows service class in design view, although I
> was
> able to initially create the service and open in design view. This
> happens
> once I restarted Visual Studio adn opened teh solution
>
> Any ideas on how to fix this would be appreciated..
>
> BR
> ::Ben


Jul 21 '05 #4

P: n/a
Chris

Thanks for loking into this..I really do appreciate the effort.

As far as I know I have not made any changes to the designer code..

Ben

"Chris, Master of All Things Insignifican" wrote:
Have you modified any code in the section that is usually commented out by
the Windows Designer. I haven't played much with windows services so I
don't remember what the template looks like, but what this is telling you is
that a change was made where the designer usually plays.

Sorry I can't be more helpful.
Chris
"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.com...
Chris

It does not show me the object;
------------start of error
One or more errors encountered while loading the designer.The errors are
listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes. Clicking on each error will take you to
the
line of code that caused it.

Object reference not set to an instance of an object.

Hide
Edit
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.AddToolboxItem(IVsHierarchy
hierarchy, String typeName, Type loadedType, String category, String
referencePath, ToolboxItemFilterAttribute projectFilter,
ToolboxItemFilterAttribute itemFilter)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager.UpdateToolboxItems(Boolean
updateRefs, Boolean updateBuild)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoT oolboxManager..ctor(AutoToolboxManagerService
ownerService, IServiceProvider provider, IVsHierarchy hierarchy, Boolean&
keepMe)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManager(Object
vsHierarchy)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.GetAutoToolboxManagerFromHost(IDesig nerHost
host)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxM anagerService.OnDesignerLoadComplete(Object
sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadCo mplete(EventArgs e)
at
System.ComponentModel.Design.DesignerHost.System.C omponentModel.Design.Serialization.IDesignerLoader Host.EndLoad(String
rootClassName, Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.OnEndLoad(Boolean
successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.OnEndLoad(Boolean
successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.System.ComponentModel.Design.Serializ ation.IDesignerLoaderService.DependentLoadComplete (Boolean
successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.BeginLoad(IDesignerLoaderHost
host)
at System.ComponentModel.Design.DesignerHost.BeginLoa d(DesignerLoader
loader)
---end of error message---
"Chris, Master of All Things Insignifican" wrote:
Do you see the object that it is complaining about.

Dim C as ClassA
C.SomeProperty = 12345 <--- Error: Object reference not set to an
instance
of an object.

Dim C as New ClassA
C.SomeProperty = 12345 <--- Happy!

So find out what object it is complaining about and assign it an instance
of
the object.

Hope this helps
Chris

"NewToDotNet" <Ne*********@discussions.microsoft.com> wrote in message
news:37**********************************@microsof t.com...
>I am getting "Object reference not set to an instance of an object. "
>when
>I
> attempt to open a C# windows service class in design view, although I
> was
> able to initially create the service and open in design view. This
> happens
> once I restarted Visual Studio adn opened teh solution
>
> Any ideas on how to fix this would be appreciated..
>
> BR
> ::Ben


Jul 21 '05 #5

P: n/a

NewToDotNet wrote:
I am getting "Object reference not set to an instance of an object. " when I attempt to open a C# windows service class in design view, although I was able to initially create the service and open in design view. This happens once I restarted Visual Studio adn opened teh solution

Any ideas on how to fix this would be appreciated..

BR
::Ben


Jul 21 '05 #6

P: n/a
I am experiencing the exact same thing with the Dec 2004 beta release.
Any resolution to this yet?

su************@eds.com wrote:
NewToDotNet wrote:
I am getting "Object reference not set to an instance of an object.
" when I
attempt to open a C# windows service class in design view, although
I was
able to initially create the service and open in design view. This

happens
once I restarted Visual Studio adn opened teh solution

Any ideas on how to fix this would be appreciated..

BR
::Ben


Jul 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.