I have a solution in Visual Studio that contains two projects: ProjectA.csproj ProjectB.csproj
At the solution level I have a Buid.Targets file that describes the steps for the build process. ProjectB is special and needs to be published as an application for both Window and Linux. To do that I have set up the Publish profiles in the project for both Windows and Linux.
My question is it possible to use the MSBuild .targets file at the solution level to generate a build that does the following: Build ProjectA Publish ProjectB for both Windows and Linux
I'm new to MSBuild, but would like to try and define these steps in the .targets file I have at the solution level if that is even possible?
Thanks
I have set up the publish profiles but am not seeing a way to "call" to those in the Build.Targets file that I have at the solution level.
For example, on my side, I have a solution with project A and project B:
You can see that there has a Build.targets file.
This is the content of the Build.targets file on my side:
And here are the content of the Windows.pubxml and Linux.pubxml on myside:
Windows.pubxml:
Linux.pubxml:
This is the structure on my side:
After the above steps, you can run the msbuild command:
msbuild /t:BuildAndPublish Build.targets
You will get the result:
You can see whether the above is what you want, if I misunderstand something, please feel free to let me know.