Let's use a publish profile on that Azure Pipeline on TFS !

So we have TFS at work and i have been planning to create a build for a vendor web app which we used the DI the vendor implemented to inject our own custom modules/apps.
i managed previously to create a customized publish profile to produce a web package that contain both the vendor DLLs and our own.


<!--Cutome entry to include custom DLLs-->
  <target name="CollectHelpers">
    <itemgroup>
      <_customfiles include="$(MSBuildProjectDirectory)\bin\Custom*.dll">
      <filesforpackagingfromproject include="%(_CustomFiles.Identity)">
        <destinationrelativepath>bin\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</filesforpackagingfromproject>
    </_customfiles>
  </target>
  <target name="CollectCustomizations">
    <itemgroup>
      <_customfiles include="$(MSBuildProjectDirectory)\bin\*Custom*.dll">
      <filesforpackagingfromproject include="%(_CustomFiles.Identity)">
        <destinationrelativepath>bin\%(RecursiveDir)%(Filename)%(Extension</DestinationRelativePath>
      </filesforpackagingfromproject>
    </_customfiles>
  </target>
  <propertygroup>
    <copyallfilestosinglefolderforpackagedependson>
      CollectHelpers;
      CollectCustomizations;
      $(CopyAllFilesToSingleFolderForPackageDependsOn);
    </copyallfilestosinglefolderforpackagedependson>

    <copyallfilestosinglefolderformsdeploydependson>
      CollectHelpers;
      CollectCustomizations;
      $(CopyAllFilesToSingleFolderForMsdeployDependsOn);
    </copyallfilestosinglefolderformsdeploydependson>
  </propertygroup>
  <!--End of Custom entry-->


finally i did manage to use that custom publish profile on my build pipeline adding this "/p:PublishProfile=$(BuildConfiguration)" to my "Build Solution" step. i used "$(BuildConfiguration)" because i named my publish profiles same name as my build configurations.

Popular posts from this blog

how to copy NuGet packages from one project to another

How to load a DLL and runtime, invoke a method by name, get result object and use it as a parameter on another unkown DLL .NET Core

Blazor how to generate that SHA256 check