How can .NET Core installer projects depend on the publish output?

30 Views Asked by At

We have a solution containing several NSIS installers. For .NET framework we used Costura.Fody to combine the various DLLs into one executable, which it does as part of the build putting the result in the projects bin directory.

The project with the NSIS installers then simply has a dependency on those .NET projects, so that they will be built first.

MySolution
  CoolApp
    CoolApp.csproj
    Program.cs
  CoolAppInstaller
    CoolAppInstaller.vcxproj // project dependency on CoolApp.csproj
    CoolAppInstaller.nsi // makensis.exe custom build step consuming CoolApp/bin/$(Configuration)/

With .NET Core, Microsoft has this functionality built in, however it seems to only exist as part of a separate publish command, and thus the final output is not available at build time to the installer projects.

Can a project specify that the dependency is the "publish" rather than "build" output?

Is Microsoft intending with .NET Core/5 that creation of installers should be entirely separate from the project build (so do dotnet build, dotnet publish ..., makensis ... outside Visual Studio / msbuild)?

0

There are 0 best solutions below