⬅ Bradenkoh.com

Build Inside Visual Studio Condition


There exists a condition inside your .csproj file where you can set a condition to run only if the build is taken place inside visual studio

The xml looks something like this

<Project Sdk="Microsoft.NET.Sdk">


  <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(BuildingInsideVisualStudio)' == 'true'">
    <Exec Command="echo Hi There!" />


This is useful if you have local post build events and don't want them to run inside an Azure pipeline.