Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BeforeBuild MSBuild target with a condition checking IsLocalDev variable
<PropertyGroup>
<IsLocalDev>true</IsLocalDev>
</PropertyGroup>
<Target Name="BeforeBuild" Condition="$(IsLocalDev) == true">
<Exec Command="CodeFormatter $(MSBuildProjectFile) /rule+:BraceNewLine,UsingLocation,FormatDocument,NewLineAbove /rule-:Copyright,CustomCopyright,UnicodeLiterals,ExplicitVisibility,IllegalHeaders,ExplicitThis,ReadonlyFields,FieldNames /verbose"
ContinueOnError="false" />
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment