0

I am trying to publish a Visual stuido Project from another Project, to do this I have created a bat file which runs my MSBuild file. If you run this outside of Visual Studio it works correctly but when i tried to add it to Visual Studio's prebuild scripts it does not publish. I am getting this warning -

 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 

My MSBuild file:

<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 is saying that my project has built correctly but i can't work out why it's not publishing, any ideas?

Chris
  • 367
  • 2
  • 18
  • 1
    Any update for this issue? Have you resolved this issue? If not, would you please let me know the latest information about this issue? – Leo Liu Oct 12 '18 at 01:45
  • @Leo i was able to test it this morning your fix worked perferctly, Thanks! – Chris Oct 12 '18 at 09:58

1 Answers1

1

Visual Studio is saying that my project has built correctly but i can't work out why it's not publishing, any ideas?

You can use another solution for this issue. Following is my publish target, you can check it:

  <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>

With this target, the project/solution will be build and published when you build the project.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135