AWolf

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 ¨C 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 2005 77718-204-0769794-41100

Microsoft Visual Basic 2005

Microsoft Visual C# 2005 77718-204-0769794-41100

Microsoft Visual C# 2005

Microsoft Visual C++ 2005 77718-204-0769794-41100

Microsoft Visual C++ 2005

Microsoft Visual J# 2005 77718-204-0769794-41100

Microsoft Visual J# 2005

Microsoft Visual Studio Tools for Office 77718-204-0769794-41100

Microsoft Visual Studio Tools for the Microsoft Office System

Microsoft Visual Web Developer 2005 77718-204-0769794-41100

Microsoft Visual Web Developer 2005

Microsoft Web Application Projects 2005 77718-204-0769794-41100

Microsoft Web Application Projects 2005

Version 8.0.50727.762

Visual Studio 2005 Team Edition for Architects 77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Architects

Visual Studio 2005 Team Edition for Developers 77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Developers

Visual Studio 2005 Team Edition for Testers 77718-204-0769794-41100

Microsoft Visual Studio 2005 Team Edition for Software Testers

Crystal Reports AAC60-G0CSA4B-V7000AY

Crystal Reports for Visual Studio 2005

Enterprise Library Configuration Editor 3.0

Microsoft patterns & practices Enterprise Library Configuration Editor

Extensions for Windows WF

Windows Workflow Foundation Tools for Visual Studio

Microsoft Recipe Framework Package 8.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 Tools 1.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 c 2003-2007 Roland Weigelt.



Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Tom Lake - MSFT

Do you have the stack trace from the NullReferenceException






Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

AWolf

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.





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Tom Lake - MSFT

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.




Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

AWolf

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





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Tom Lake - MSFT

I still have not received your email.






Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

AWolf


I will send it again tommorrow.





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

AWolf

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.





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

ld

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





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Tony Fryer2

Just confirming that I have also seen this behaviour. Removing the setup project from the solution allowed me to set breakpoints in the workflow.




Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Joe Fairchild

I also had this same problem, and removing the setup project from the solution allowed me to create break points. This doesn't seem like a very good fix but it works. I instead created a debugging solution, and a deployment solution. I hope this is fixed in the next deployment.





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Dr Adrian Colquhoun

Yep

I've just stumbled across this one too. I have a fairly large workflow solution (20 projects). I have just completed a fairly extensive refactoring (moving workflows to different assemblies, signing assemblies, adding a WCF service, reworking the designer code that want automatically refactored). Also had to merge changes into the visual studio solution file at the same time (to pull in another developers changes).

Once I finally go the solution to recompile I have the same problem - "object refernce not set " when trying to set a breakpoint on the workflow designer (its fine in code view). Its seems to becoming from deep inside visual studio - I tried Toms suggestions of turning all the exceptions on and attaching to the process - to no avail.

I then tried

  • a new solution - problem persisted
  • a new solution without the WCF service - problem persisted

I then returned to the existing solution and removed its existing setup project (which wasnt being built anyway) and Voila - breakpoints restored !

Regards

Adrian






Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Dr Adrian Colquhoun

It seems I was a bit too hasty with my previous post. While removing the setup project allows breakpoints to be set in the designer, they do not work (i.e. visual studio does not break on them) at runtime. It will howver stop on breakpoints set in the .cs file of the same workflow.

When executing, the designer breakpoints show the yellow warning triangle (which I assume to mean "I'm not runing the code you think I'm running ")

So far I have tried:

  • Removing the visual studio SDK (which I had installed)
  • Repairing visual studio 2008

I changed some code in an activity called by one of the workflows (to write out some extra logging statements) - this code was called OK.

I then added a code activity to the workflow itself (with a simple console.writeline) - I now have an obscure errror while tring to compile the workflow

  • "AL.exe" exited with code -1073741515.

Nothing much on google on this - anyone got any ideas






Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

AWolf

My problems also started with a major refactoring, but removing the setup project worked well for me. I would love to see some MS folks looking into this issue, but I do not know if this is a big problem for workflow. I would guess it is not, I have not had the same problem again.

I was wondering what type of workflow you are using and what type - code or xoml / xaml.

Are you using 2005 or 2008 What versions of the framework are you using 3.0 or 3.5

Adam





Re: Windows Workflow Foundation Visual Studio : Object reference not set Error when trying to insert a brealpoint?

Dr Adrian Colquhoun

Adam

Code workflows in VS2008 / 3.5

I have completely removed and reinstalled VS2008 to no avail - I still cant get the debugger to break on any breakpoints set into the designer (though my al.exe issue disappeared). If I add a new setup project to my solution the "object reference not found bug" comes straight back (cant set breakpoints) - I need to do a build and release today so this is a bit frustrating!

This is one of a long line of issues I have encountered refactoring workflow code in VS2008 - it doesnt really lend itself to agile development - very frustrating!

I did ihave the beta ersion of VS2008 on this machine and one suspicion I have is that VS2008 is not installed correctly. It seems to show beta 2 on the splach screen but RTM on the help/about dialog. Do you have the same or are you on different versions

Adrian