© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
C
C#
•
4y ago
•
5 replies
swagrid
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
dotnet pack MyProject
should cause the target to run while
dotnet build MyProject
dotnet build MyProject
shouldn
't
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
dotnet 8 windows target
C
C# / help
3y ago
✅ dotnet pack command fails
C
C# / help
10mo ago
MSBuild doesn't detect files created using Target
C
C# / help
2y ago
dotnet run throws segfault
C
C# / help
2y ago