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
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
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>
According the documentation, you can add commands, in scripts
section, in project.json
file.
"scripts": {
"precompile": [ "echo before" ],
"postcompile": [ "echo after" ]
}