none
ClickOnce Post-Deployment Action crashes during Update

    Question

  • Hi!

    I am trying to perform post-deployment action for document-level Excel customization.
    Using link
    http://msdn.microsoft.com/en-us/library/ff961899.aspx
    I have implemented xlsx file copying to the desktop. But it is just initial version installation. What if newer version will be published?
    I have verified 2 ways in this case:

    1. ClickOnce setup.exe is called remotely from file share - that is ok (but it is a manual update action).

    2. Automatic update on document opening on client PC. It is the most important step for me. Update ClickOnce action starts but fails with the following exception:

    Name: RoadmapWorkbook
    From: file://Vlad-PC/publish/RoadmapWorkbook.vsto
    
    ************** Exception Text **************
    Microsoft.VisualStudio.Tools.Applications.Deployment.InstallAddInFailedException: The following assembly for a post-deployment action cannot be found: "PostDeploymentAction, Version=1.0.0.0, Culture=neutral, ProcessorArchitecture=msil".
      at Microsoft.VisualStudio.Tools.Applications.Deployment.PostDeploymentActionsHost.Execute(Int32& lastExecutedPostAction, Uri deployManifestUri, AddInInstallationStatus installStatus, String deployManifestXml, String appManifestXml, String hostManifestXml, String[] postActionDataXmls, String productName, String version, String applicationBase, Boolean forward, String[] assemblyClassNames, String[] assemblyNames, String[] assemblyFullNames)
      at Microsoft.VisualStudio.Tools.Applications.Deployment.PostDeploymentActionsHost.Execute(Int32& lastExecutedPostAction, Uri deployManifestUri, AddInInstallationStatus installStatus, String deployManifestXml, String appManifestXml, String hostManifestXml, String[] postActionDataXmls, String productName, String version, String applicationBase, Boolean forward, String[] assemblyClassNames, String[] assemblyNames, String[] assemblyFullNames)
      at Microsoft.VisualStudio.Tools.Applications.Deployment.ClickOnceAddInDeploymentManager.InvokePostActions(Uri deploymentUri, AddInInstallationStatus installStatus, String deployManifestXml, String appManifestXml, ApplicationManifest manifest, String productName, String version, AppDomainSetup appDomainSetup)
      at Microsoft.VisualStudio.Tools.Applications.Deployment
    

    E.g. explicit update works correctly whereas implicit auto-update fails :(.

    My deploy and app manifests are default (generated by VS), except required changes for Post-Deployment action described above.

     

    Would you help with solving this issue?

     

    Thanks,

       Vlad

    Tuesday, February 15, 2011 11:23 AM

Answers

  • RobinDotNet,

    I solved my issue:

    1. I switched application pool for IIS to use .NET 4.0.

    2. I discovered that auto-update does not work correctly for user where development takes place.

        I have created new user - and all is working now.

     

    Thanks a lot for cooperation!!!  

     

    • Marked as answer by Vlad Yanum Monday, March 21, 2011 4:46 PM
    Monday, March 21, 2011 4:46 PM

All replies

  • Hi Clad,

    Base on the error messages, to check in your porst-deployemt action, whether has added the assembly in.

    >E.g. explicit update works correctly whereas implicit auto-update fails :(.

    What do you mean of that? What is the explicit update? Does the implicit auto-update mean the default updating behavior of the clickonce?
    And also to check your code is performed steps as the link  http://msdn.microsoft.com/en-us/library/ff961899.aspx describes. As it already says "The code that you add to the Execute method runs when the application is installed, updated or uninstalled", so there maybe something you have missed.

    Sincerely,
    Vin Jin


    Vin Jin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, February 17, 2011 8:12 AM
  • VinJin -- I think he means that if it auto-updates when the user runs Excel, it fails, but if the user reruns the installation from the link to setup.exe, it works.

    No idea what's going on here, but I'll ask the C/O product guy at MSFT next time I talk to him if this thread is still open.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Thursday, February 17, 2011 8:48 AM
    Moderator
  •  

    Vin Jin,

    I performed all steps from the link you have provided (BTW, I pointed the same link in my initial post). Update action completes successfully when you explicitly click link to setup.exe (as RobinDonTet said)

    RobinDonTet ,

    Yes, You are right -  Update action fails when user runs Excel. So the thread is still open...

    Thanks a lot for assistance!

     

    Regards,
        Vlad Yanum

    Friday, February 18, 2011 10:19 AM
  • Hi,

    Can you please verify that the version of the .NET Framework that you are targeting with your post-deployment action matches the target for your add-in?

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Saturday, March 05, 2011 12:30 AM
    Moderator
  • RobinDotNet,

    I solved my issue:

    1. I switched application pool for IIS to use .NET 4.0.

    2. I discovered that auto-update does not work correctly for user where development takes place.

        I have created new user - and all is working now.

     

    Thanks a lot for cooperation!!!  

     

    • Marked as answer by Vlad Yanum Monday, March 21, 2011 4:46 PM
    Monday, March 21, 2011 4:46 PM