本文介绍了创建要构建的msbuild脚本,使用指定的app.config发布,以及从不同位置更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想要一个msbuild脚本来执行以下操作:




  • 使用指定的app.config(app.config.debug或app.config)发布构建的解决方案。发布)到指定的文件夹(开发或生产)

  • 使用指定的配置,知道在哪里检查更新。

    -if部署 - >检入示例生产文件夹

    -if开发 - >检入示例开发文件夹

  • 脚本目前有效,但有两个问题...




    • 我不知道如何两个不同的安装,检查两个不同的地方检查更新。

    • 我无法自动递增修订版本。



    我的当前脚本:

      msbuildC:\sample\sample.csproj
    / t:clean
    / t: build
    / t:publish
    / p:Configuration = release
    / property:PublishDir =C:\Samplelocation /
    / property:UpdatedEnabled = true
    / property:UpdateRequired = true
    / property:UpdateUrl =C:\Samplelocation /
    / property:GenerateManifests = true
    / property:PublishWizardCompleted = true

    任何帮助将非常感谢。提前感谢!

    解决方案

    您应该看看MSBuild 。



    批处理:









    I have googled everywhere for this solution and cannot find anything!

    I want to have a msbuild script to do the following:

    1. Build the project solution
    2. Publish the built solution with the specified app.config (app.config.debug or app.config.release) to a specified folder (Development or Production)
    3. With the specified configuration, know where to check for updates.
      -if deployment -> check in the sample production folder
      -if development -> check in the sample development folder

    The script currently works but there are two problems...

    • I cannot figure out how to have two different installations that check two different places to check for updates.
    • I cannot auto increment the revision build. It currently stays at the same build number everytime i use the script.

    My Current script:

    msbuild "C:\sample\sample.csproj"
    /t:clean
    /t:build
    /t:publish
    /p:Configuration=release
    /property:PublishDir="C:\Samplelocation/"
    /property:UpdatedEnabled=true
    /property:UpdateRequired=true
    /property:UpdateUrl="C:\Samplelocation/"
    /property:GenerateManifests=true
    /property:PublishWizardCompleted=true
    

    Any help would be greatly appreciated. Thanks ahead of time!

    解决方案

    You should take a look at MSBuild Batching.

    Here are some links on batching:

    这篇关于创建要构建的msbuild脚本,使用指定的app.config发布,以及从不同位置更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    11-01 19:32