locked
Cannot start debugging a project RRS feed

  • Question

  •  

    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?

    Wednesday, August 1, 2007 4:39 PM

Answers

  • 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?

    Monday, August 6, 2007 5:53 PM

All replies

  • 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?

    Monday, August 6, 2007 5:53 PM
  • This must be a bug.

    When I clean the solution and then re-run it, everything works.  
    • Proposed as answer by yom Sunday, December 20, 2009 8:32 PM
    Wednesday, April 22, 2009 3:16 PM
  • This must be a bug.

    When I clean the solution and then re-run it, everything works.  
    I had the same. It turned out I typed a Revision number of 6 digits long by mistake (in Publish tab). No complaints whiloe publishing, only when starting (in debug mode) with this number the problem surfaced...
    Sunday, December 20, 2009 8:34 PM
  • My problem resolution to this was to unclick all the Click-Once settings I was working on (which I haven't yet fixed)  But at least now I can get the project up in Debug mode....
    Javaman
    Friday, July 16, 2010 3:10 AM