Cannot start debugging a project

I have a WPF forms application, which I've left dormant for a while, and come back to, however when I try to debug it I get the following exception:

Value cannot be null.\r\nParameter name: activationContext

" at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"

As the trace shows this happens before my code starts so I'm not sure whats causing it.

When I came back to it it said "Cannot find PresentationCore.dll", I've seen this before and removing and re-adding the PresentationCore.dll reference fixed it then. I've also tried a default WPF application and after updating the PresentationCore.dll reference that works.

To the best of my knowledge this program compiled and ran fine before I left it. Can anyone offer pointers to where the problem could be?

[1245 byte] By [AWilco] at [2008-2-5]
# 1

The first message and strack trace you posted just seems to tell you that your application was having problems. The "hosting process" couldn't load it for your debug session.

The second error you mention, about the reference to PresentationCore.dll, is definitely more interesting. You mention that it was working a while ago, but you recently came back to it and it now has this problem. The first thing to think about is what happened to your machine between the time your program was working and now? Did you install anything new? Uninstall anything?

Just to be sure - you've already deleted and re-added the PresentationCore.dll reference and it didn't help? And completely new projects work?

ScottNonnenbergMSFT at 2007-10-2 > top of Msdn Tech,Visual Studio Orcas,Visual C# Express Orcas...

Visual Studio Orcas

Site Classified