Is there any way to add prebuild/postbuild options in dotnet core projects in Visual Studio ?
There is no option to add build events in project properties as it used to be with Standard dot net projects
According the documentation, you can add commands, in scripts
section, in project.json
file.
"scripts": {
"precompile": [ "echo before" ],
"postcompile": [ "echo after" ]
}
Here is an example:
<Project... >
:
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="echo before" />
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="echo after" />
</Target>
:
</Project>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With