Giter Club home page Giter Club logo

customsolutiontargets's Introduction

Custom Solution Targets

Light weight extension for visual studio 2022. before and after targets are supported from msbuild but they will not work with visual studio. They are useful when you need to take some actions before build or publish of the whole solution, for example:

you can stop the iis or any interfering service before starting the build and start it when the visual studio is done.

How to:

You can create you desired target in this format in the solution folder:

  • before.[solution-name].sln.targets: before.MySolution.sln.targets
  • after.[solution-name].sln.targets: after.MySolution.sln.targets

both files need to be in a valid project format:

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="MyBeforeSolutionTrigger" BeforeTargets="Build">
        <Message Importance="High" Text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
        <Message Importance="High" Text="Solution Build Started. *********" />
        <Message Importance="High" Text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    </Target>
</Project>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Target Name="MyAfterSolutionTrigger" AfterTargets="Build">
        <Message Importance="High" Text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
        <Message Importance="High" Text="Solution Build Ended. *********" />
        <Message Importance="High" Text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
    </Target>
</Project>

Sample output:

Build started...
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Solution Build Started. *********
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1>------ Build started: Project: WebApplication1, Configuration: Debug Any CPU ------
2>------ Build started: Project: WebApplication2, Configuration: Debug Any CPU ------
1>  WebApplication1 -> C:\Users\GA\source\repos\WebApplication2\deploy\bin\Debug\WebApplication1.dll
1>  Publishing project WebApplication1.
2>  WebApplication2 -> C:\Users\GA\source\repos\WebApplication2\deploy\bin\Debug\WebApplication2.dll
1>  Copying all files to temporary location below for package/publish:
1>  obj\Debug\Package\PackageTmp.
2>  Publishing project WebApplication2.
2>  Copying all files to temporary location below for package/publish:
2>  obj\Debug\Package\PackageTmp.
========== Build: 2 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Build Ended. *********
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

customsolutiontargets's People

Contributors

gaaops avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.