locked
Value cannot be null. Parameter name: activationContext

    Question

  • when I start application I have masage,

    Value cannot be null.  Parameter name: activationContext

    vs 2010 express

    win 7

    sorry bad english

    tnx

    Friday, September 10, 2010 6:47 PM

Answers

  • Hi Ddr,

     

    Welcome to MSDN forums.

     

    “when I start application I have masage,

    Value cannot be null.  Parameter name: activationContext”

    è   

    You can handle the UnhandledException event of the application and get all the information available about the exception like this:

     

    Project menu -> Properties -> Application tab -> “View Application Events” button

    Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles       

    Me.UnhandledException

         MessageBox.Show(e.Exception.ToString)

         e.ExitApplication = False

    End Sub

     

    Additionally, Joe came across the similar issue “Value cannot be null. Parameter name: activationContext” in the following thread and fixed it. Please double check whether there is circular reference in your project.

    http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/b5ac9ae2-fffa-4d5a-b8f8-d8fdc00b7733

    “My app is called SpotLight.  In Solution Explorer, if you double click My Project, and then click the References Tab, I had a Reference to SpotLight.  How it got there I'm not sure.  I did not put it there, but it apprently causes some kind of circular reference which caused Click Once to fail and my App to no longer run after a Publish.

    To fix my problem I simply clicked on the SpotLight reference and deleted it.  Problem solved.”

     

     

    Best regards,

    Martin Xie

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, September 13, 2010 5:23 AM

All replies

  • Please post a snippet of code around location where error occurred.

     

    Saturday, September 11, 2010 12:25 AM
  • Hi Ddr,

     

    Welcome to MSDN forums.

     

    “when I start application I have masage,

    Value cannot be null.  Parameter name: activationContext”

    è   

    You can handle the UnhandledException event of the application and get all the information available about the exception like this:

     

    Project menu -> Properties -> Application tab -> “View Application Events” button

    Private Sub MyApplication_UnhandledException(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs) Handles       

    Me.UnhandledException

         MessageBox.Show(e.Exception.ToString)

         e.ExitApplication = False

    End Sub

     

    Additionally, Joe came across the similar issue “Value cannot be null. Parameter name: activationContext” in the following thread and fixed it. Please double check whether there is circular reference in your project.

    http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/b5ac9ae2-fffa-4d5a-b8f8-d8fdc00b7733

    “My app is called SpotLight.  In Solution Explorer, if you double click My Project, and then click the References Tab, I had a Reference to SpotLight.  How it got there I'm not sure.  I did not put it there, but it apprently causes some kind of circular reference which caused Click Once to fail and my App to no longer run after a Publish.

    To fix my problem I simply clicked on the SpotLight reference and deleted it.  Problem solved.”

     

     

    Best regards,

    Martin Xie

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, September 13, 2010 5:23 AM
  • tnx

    problem is solved

    Monday, September 13, 2010 9:44 AM
  • Hello,


    Today, I got exactly the same problem.
    But when I try the first option it gives me the error: Event 'UnhandledException' cannot be found.

    Can anybody help me?

    Tuesday, March 22, 2011 11:42 AM
  • Hello,


    Today, I got exactly the same problem.
    But when I try the first option it gives me the error: Event 'UnhandledException' cannot be found.

    Can anybody help me?

    Nobody?
    Sunday, April 10, 2011 12:38 PM
  • Same here Niels1567, have a look at the references in Project/'projectname' Properties. You'll find a reference to your project there, like is mentioned in Martin Xiel's answer. I used the "Unused References..." button and then "Removed" the results. It fixed it.

    Not sure about your problem, but my debugger didn't come up with any specific line of code that had an error. Looks like a Bug to me. VS2010 SP1 seems to be buggier than pre-SP1.

    Sunday, April 10, 2011 1:40 PM
  • Same here Niels1567, have a look at the references in Project/'projectname' Properties. You'll find a reference to your project there, like is mentioned in Martin Xiel's answer. I used the "Unused References..." button and then "Removed" the results. It fixed it.

    Not sure about your problem, but my debugger didn't come up with any specific line of code that had an error. Looks like a Bug to me. VS2010 SP1 seems to be buggier than pre-SP1.

    THAT'S IT !!!! THX.   For google, may solve Problem with Tags :  Parametername: activationContext    {"Der Wert darf nicht NULL sein.\r\nParametername: activationContext"}   SMDiagnostics 4.0.0.0 Visual Basic .Net Express 2010 Quellen suchen Projekt nicht ausführbar
    • Proposed as answer by Acidrain0815 Tuesday, August 09, 2011 9:56 PM
    • Unproposed as answer by Acidrain0815 Tuesday, August 09, 2011 9:57 PM
    • Proposed as answer by Acidrain0815 Tuesday, August 09, 2011 9:57 PM
    Tuesday, August 09, 2011 9:54 PM
  • try unchecking the "enable clickonce security settings" checkbox in the security tab of the application properties(Projects Tab -> "Project Name" Properties-> Security Tab).
    • Proposed as answer by Faisal Imam Tuesday, June 12, 2012 3:55 PM
    Sunday, December 04, 2011 3:00 PM
  • Just had the same issue, it was due to a circular reference in my project

    Thanks Martin!

    Friday, May 04, 2012 10:45 AM
  • try unchecking the "enable clickonce security settings" checkbox in the security tab of the application properties(Projects Tab -> "Project Name" Properties-> Security Tab).
     Thanks a lot. This solved my problem
    Tuesday, June 12, 2012 3:56 PM
  • Thanks a lot. This solved my problem.

    Saturday, June 30, 2012 4:14 AM