Setting up automatic backups in Web Deploy tool

前端 未结 2 781
执笔经年
执笔经年 2021-02-13 18:43

I\'ve been struggling to setup automatic backup, but seems to have hit a wall. Following this document, and using Powershell, I\'ve enabled the backups (TurnOn-Backups -On $

相关标签:
2条回答
  • 2021-02-13 18:57

    Short Answer: Currently broken in VS 2010 "Web One Click Publish" feature. :'(

    I spent nearly an entire week working closely with the MS Dev team and trying everything imaginable on this one and have yet to find a solution that doesn't involve the msdeploy.exe command utility (i.e. no luck for doing this from VS directly using the "Web One Click Publish" feature). :(

    Hopefully they make a patch to address this issue in VS 2010 SP1. Web Deploy is supported (See "Features" section) but the Automatic Backup feature is not. I know this isn't the answer you were looking for, nor was I, but the sad fact of the matter nevertheless.

    I think the best you can hope for at this point is as Sayed answered here, and while old, remains the only solution at this time (Note: The msbuild tab for the old VS 2008 Web Site template is now "Build Events" under the Compile tab in VS 2010 Web App projects). Only downside to this method is that it will create a backup every time you compile, not just when you deploy. Otherwise you'll have to write a special script that you run prior to each publish.

    On a side note, you can also edit your web deploy configuration via IIS Manager at the server level using the "Configuration Editor" (must have the Management role installed).

    enter image description here

    0 讨论(0)
  • 2021-02-13 19:21

    I managed to get VS2010 to deploy automatic backups, by stealing some ideas from this question: msdeploy (Web Deploy) failing with 401 auth issues

    First install Web Deploy v3.5 on your local computer - the one with VS2010 installed on it.

    Now edit your VS2010 environment config:

    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
    # or
    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config
    

    Find the <assemblyBinding> node, and add the following just inside it:

    <dependentAssembly>
        <assemblyIdentity 
            name="Microsoft.Web.Deployment" 
            publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="7.1.0.0" newVersion="9.0.0.0"/>
    </dependentAssembly>
    

    Save, and restart VS2010.

    You should now find you can use one click publishing in VS2010 to push to a server running Web Deploy v3, and if you've configured backups correctly on the server (see @Chiramisu's answer) then backups should be successfully created! Woop!

    0 讨论(0)
提交回复
热议问题