【问题标题】:MSBUILD command not able to create artifactsMSBUILD 命令无法创建工件
【发布时间】:2020-06-01 11:40:49
【问题描述】:

尝试使用 MSbuild 构建 asp.net Web 应用程序。构建成功,但在 build_output 文件夹中仅存在 DLL。当我从 Visual Studio 发布时,我会得到一个不同的输出,我可以将其部署到 IIS。但是 MSBUILD 给出了不同的输出。我想要与来自 Visual Studio 的发布相同的输出。

我正在使用的命令:

msbuild ASPWebApp.sln /t:Build /p:DeployOnBuild=true /p:Configuration=Release /p:outdir=.\build_output

【问题讨论】:

    标签: c# msbuild devops


    【解决方案1】:

    Web 应用程序构建使用不同的目标。尝试“/t:WebPublish”目标。

    /t:WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl="c:\build\output"
    

    【讨论】:

    • 根据您的建议更新命令 .msbuild ASPWebApp/ASPWebApp.csproj /p:Configuration=Release /t:WebPublish /p:WebPublishMethod=FileSystem /p:publishUrl=.\output。收到错误The target "WebPublish" does not exist in the project
    • 看看这个答案9169341
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-12
    • 2016-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多