【问题标题】:Visual Studio 2017 MSBuild issueVisual Studio 2017 MSBuild 问题
【发布时间】:2018-10-10 11:19:31
【问题描述】:

我正在尝试从另一个项目发布 Visual stuido 项目,为此我创建了一个运行我的 MSBuild 文件的 bat 文件。如果您在 Visual Studio 之外运行它,它可以正常工作,但是当我尝试将它添加到 Visual Studio 的预构建脚本时,它不会发布。我收到了这个警告 -

 C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1820,5): warning MSB3247: Found confl
icts between different versions of the same dependent assembly. In Visual Studio, double-click this warning (or select
it and press Enter) to fix the conflicts; otherwise, add the following binding redirects to the "runtime" node in the a
pplication configuration file 

我的 MSBuild 文件:

<Target Name="BeforeBuild">
<MSBuild
        Projects="E:\Development\alyz\myAPI\View.API.sln"
        Targets="View_API_Search"
        Properties="DeployOnBuild=true;Configuration=Release;PublishProfile=InstallerPublish;WebPublishMethod=FileSystem;PublishURL=E:\Temp\installertemp\SearchAPI" /> 
</Target>

Visual Studio 说我的项目已正确构建,但我无法弄清楚为什么它没有发布,有什么想法吗?

【问题讨论】:

  • 这个问题有什么更新吗?你解决了这个问题吗?如果没有,请告诉我有关此问题的最新信息吗?
  • @Leo 我今天早上能够对其进行测试,您的修复工作非常完美,谢谢!

标签: visual-studio msbuild visual-studio-2017 visual-studio-2017-build-tools


【解决方案1】:

Visual Studio 说我的项目已正确构建,但我不知道为什么它没有发布,有什么想法吗?

您可以使用其他解决方案来解决此问题。以下是我的发布目标,您可以查看:

  <Target Name="BeforeBuild">
    <Exec Command="&quot;<YourMSBuild.exePath>\msbuild.exe&quot; &quot;<YourSolutionPath>\View.API.sln&quot; /p:DeployOnBuild=true /p:PublishProfile=InstallerPublish.pubxml /p:Configuration=Release /p:PublishURL=E:\Temp\installertemp\SearchAPI"></Exec>
  </Target>

使用此目标,项目/解决方案将在您构建项目时构建和发布。

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2019-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-21
    • 1970-01-01
    • 2012-09-13
    • 2017-08-31
    • 2018-06-09
    相关资源
    最近更新 更多