locked
Publish does not generate publish.htm RRS feed

  • Question

  • We have several clickonce applications that were created using Visual Studio 2008 and then upgraded to Visual Studio 2010 on Windows XP 32-bit.  These applications were publishing just fine under XP.

    Following a hard drive failure, our LAN department upgraded my machine from XP 32-bit to Windows 7 64-bit.  I had to make one change to the project: targeting the x86 platform instead of "Any CPU" due to the use of OleDB v12.  Other than that, I made no changes to the project.  Now when I publish, a "publish.htm" file is no longer generated.  I have tried choosing "Any CPU" again but it still does not generate publish.htm.

    For now, I'm using the publish.htm file that was already on our web servers, but I don't want to have to manually edit this file every time we deploy.  I have done a comparison of the project file before and after building on my new machine and the only differences are publish version numbers and the addition of a section for the x86 target platform.

    Does anybody know how to make Visual Studio 2010 create the publish.htm file again?

    Monday, January 10, 2011 6:51 PM

Answers

  • Go to the publish tab in the main project's properties and click the Options button to bring up the Options dialog.

    Select the Deployment tab.

    In "Deployment web page", put in "publish.htm".

    Check the box before "Automatically generate deployment web page after every publish".

    Then publish it; it should generate the publish.htm file.

    By the way, if you change the target framework and redeploy a new version, your users will all have to uninstall and reinstall the application. This is part of the identity of the deployment, and there's nothing you can do about it unfortunately. You may not have to change from 'any cpu' to 'x86'; it usually depends on your 3rd party assemblies. For example, DirectX only works when run as a 32-bit application. In other words, try it as 'any cpu' and if it works, you don't have to change it.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    • Edited by RobinDotNet Tuesday, January 11, 2011 10:37 AM add more info
    • Marked as answer by TfsUser123 Wednesday, January 12, 2011 6:02 PM
    Tuesday, January 11, 2011 10:34 AM

All replies

  • Go to the publish tab in the main project's properties and click the Options button to bring up the Options dialog.

    Select the Deployment tab.

    In "Deployment web page", put in "publish.htm".

    Check the box before "Automatically generate deployment web page after every publish".

    Then publish it; it should generate the publish.htm file.

    By the way, if you change the target framework and redeploy a new version, your users will all have to uninstall and reinstall the application. This is part of the identity of the deployment, and there's nothing you can do about it unfortunately. You may not have to change from 'any cpu' to 'x86'; it usually depends on your 3rd party assemblies. For example, DirectX only works when run as a 32-bit application. In other words, try it as 'any cpu' and if it works, you don't have to change it.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    • Edited by RobinDotNet Tuesday, January 11, 2011 10:37 AM add more info
    • Marked as answer by TfsUser123 Wednesday, January 12, 2011 6:02 PM
    Tuesday, January 11, 2011 10:34 AM
  • Thank you, Robin.  That was the answer!  I'm not sure why projects are loading with that option turned off now.  I recall in VS 2008 it was just a checkbox and I didn't have to manually enter "publish.htm".  On my XP machine, in VS 2010 it always generated publish.htm as well.  This did the trick, though.  Thanks!

    As for targeting "x86" instead of "Any CPU", it is necessary in this case.  I'm using OleDB 12.0 to read Excel spreadsheets and it throws an exception at runtime if I'm running the app in 64-bit mode.  Changing the target to x86 allows it to run without any issues.

    I did discover that the automatic updates no longer work and informed the users that a manual uninstall and reinstall from the web page is required.  In this case, there are only about ten users and they are all internal so it's not a big deal.

    Thanks for your help!

    Wednesday, January 12, 2011 6:06 PM
  • Cool, glad that it helped.

    You're lucky that you have few enough users to have them uninstall and reinstall. I have thousands of customers, so it becomes a bigger problem. I figured out how to programmatically uninstall and reinstall the application FOR the user, which helped a lot.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev
    Wednesday, January 12, 2011 11:05 PM
  • I'm using VS2012 - the "Automatically generate deployment web page after every publish" is checked, however the file isn't being generated.

    Looks like a bug - I had to untick and then re-check the box and re-enter publish.htm.

    • Edited by Peter_D503 Tuesday, April 9, 2013 2:24 AM
    Tuesday, April 9, 2013 2:22 AM