Run msbuild target only during dotnet pack
Is it possible to run a msbuild target in a csproj only when it's packaged to a nuget package, i.e.
dotnet pack MyProject
should cause the target to run while dotnet build MyProject
shouldn't.1 Reply
Hmm I have a target right now that looks like this
which isn't executed
removing the condition doesn't change anything
that didn't help. but i just found out its my project properties. i do
to not generate and package any dotnet assembly. but this seems to skip pack entirely
yeah if i remove these properties the target runs