Object Reference not set to an instance of an object

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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.AutoToolboxManagerService.AddToolboxItem(IVsHierarchy
hierarchy, String typeName, Type loadedType, String category, String
referencePath, ToolboxItemFilterAttribute projectFilter,
ToolboxItemFilterAttribute itemFilter)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager.UpdateToolboxItems(Boolean updateRefs, Boolean updateBuild)
at
Microsoft.VisualStudio.Design.Toolbox.ProjectAutoToolboxManager..ctor(AutoToolboxManagerService
ownerService, IServiceProvider provider, IVsHierarchy hierarchy, Boolean&
keepMe)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxManagerService.GetAutoToolboxManager(Object vsHierarchy)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxManagerService.GetAutoToolboxManagerFromHost(IDesignerHost host)
at
Microsoft.VisualStudio.Design.Toolbox.AutoToolboxManagerService.OnDesignerLoadComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadComplete(EventArgs e)
at
System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.Serialization.IDesignerLoaderHost.EndLoad(String
rootClassName, Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.System.ComponentModel.Design.Serialization.IDesignerLoaderService.DependentLoadComplete(Boolean successful, ICollection errorCollection)
at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
at System.ComponentModel.Design.DesignerHost.BeginLoad(DesignerLoader loader)
---end of error message---
 
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
 
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
 
NewToDotNet said:
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
 
I am experiencing the exact same thing with the Dec 2004 beta release.
Any resolution to this yet?
 
Back
Top