Visual Studio : Object reference not set Error when trying to insert a brealpoint?

I am getting an error when trying to add a breakpoint to a state machine workflow in the visual studio designer.This just started happening and I don’t know why.

Reproducible:

  • Open workflow
  • Right click and select breakpoint – add breakpoint
  • Error Object reference not set to an instance of an object.
  • Nothing in the event viewer

I can reproduce this error on other workflows added to the project. If I start another workflow in a new project, I do not have this problem.

UPDATE

Adding the workflow project to a new blank solution fixes this error. I have deleted the SUO file from the original solution (1.2 MB) but this had no effect.

Help would be appreciated.

This is my current environment

XP pro sp2

Pentium 4 3.20 with 2gb ram

Microsoft Visual Studio 2005

Version 8.0.50727.762(SP.050727-7600)

Microsoft .NET Framework

Version 2.0.50727

Installed Edition: Enterprise

Microsoft Visual Basic 200577718-204-0769794-41100

Microsoft Visual Basic 2005

Microsoft Visual C# 200577718-204-0769794-41100

Microsoft Visual C# 2005

Microsoft Visual C++ 200577718-204-0769794-41100

Microsoft Visual C++ 2005

Microsoft Visual J# 200577718-204-0769794-41100

Microsoft Visual J# 2005

Microsoft Visual Studio Tools for Office77718-204-0769794-41100

Microsoft Visual Studio Tools for the Microsoft Office System

Microsoft Visual Web Developer 200577718-204-0769794-41100

Microsoft Visual Web Developer 2005

Microsoft Web Application Projects 200577718-204-0769794-41100

Microsoft Web Application Projects 2005

Version 8.0.50727.762

Visual Studio 2005 Team Edition for Architects77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Architects

Visual Studio 2005 Team Edition for Developers77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Developers

Visual Studio 2005 Team Edition for Testers77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Testers

Crystal ReportsAAC60-G0CSA4B-V7000AY

Crystal Reports for Visual Studio 2005

Enterprise Library Configuration Editor3.0

Microsoft patterns & practices Enterprise Library Configuration Editor

Extensions for Windows WF

Windows Workflow Foundation Tools for Visual Studio

Microsoft Recipe Framework Package8.0

This package provides services to the guidance packages.

Microsoft Visual Studio 2005 Team Suite - ENU Service Pack 1 (KB926601)

This service pack is for Microsoft Visual Studio 2005 Team Suite - ENU.

If you later install a more recent service pack, this service pack will be uninstalled automatically.

For more information, visit http://support.microsoft.com/kb/926601

Orcas Technology Preview - .NET Framework 3.0 Development Tools1.0

Microsoft Visual Studio Code Name Orcas Community Technology Preview - Development Tools for WinFX

GhostDoc for Visual Studio 2005

For more information about GhostDoc, see the GhostDoc website

at http://www.roland-weigelt.de/ghostdoc

Copyright ? 2003-2007 Roland Weigelt.

[11696 byte] By [AWolf] at [2008-1-7]
# 1

Do you have the stack trace from the NullReferenceException?

TomLake-MSFT at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 2

This error is comming from Visual Studio itself, not my running code. I have fixed my problem by loading the same project into a new solution. This for some reason fixed the setting breakpoint error. I have also deleted the SUO file with no luck.

Thank you for taking the time to help me with this error.

AWolf at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 3
Can you try attaching to the instance that reproduces the error with another instance of VS? After attaching bring up the Exceptions dialog from the Debug menu. Under Common Language Runtime Exceptions expand System. Make sure the check box under Thrown and User-unhandled for System.NullReferenceException are checked. If it breaks in the attached instance you should be able to get the call stack. This is the only way to tell where the error is occurring. If you aren't able to get the stack trace can you send the project to me? My email address is in my profile.
TomLake-MSFT at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 4

VS would not break when I attached the debugger and caused VS to throw an exception. I have sent you an email with the full project and two solution files. One that works fine and the other throws the exception.

Adam

AWolf at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 5

I still have not received your email.

TomLake-MSFT at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 6

I will send it again tommorrow.

AWolf at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 7

While preparing a copy of the solution for emailing to you(again) I removed other projects from the same solution, and now I can add breakpoints to the workflow designer!!!

I removed:

Windows service project

Service installer project

Console Host project (Debugging workflow server)

So I went back to the original project and verified that I was still having the breakpoint problem, and I was. I then removed the windows installer project and now I can add breakpoints to the workflow designer.

Ok weird…. but it fixes my problem. I hope this helps someone.

AWolf at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...
# 8

Ok, so I'm getting the same issue. I also removed the setup project from my solution and can now set breakpoints. We would like to be able to set breakpoints with the client setup project as part of the solution. Is there a fix for this issue?

ld at 2007-10-2 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified