0

我正在尝试从另一个项目发布 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 说我的项目已经正确构建,但我不知道为什么它没有发布,有什么想法吗?

4

1 回答 1

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>

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

希望这可以帮助。

于 2018-10-11T03:31:58.480 回答