You can do that by adding the following in your project file:
For example, let's say you want to copy your package to a network share after packing it. (For NuGet 3.x and earlier, you use the pack and restore commands through the NuGet CLI instead.) Target build orderīecause pack and restore are MSBuild targets, you can access them to enhance your workflow. For instructions creating a NuGet package using MSBuild, see Create a NuGet package using MSBuild. These targets allow you to work with NuGet as you would with any other MSBuild task or target. With MSBuild 15.1+, NuGet is also a first-class MSBuild citizen with the pack and restore targets as described below. With the PackageReference format, NuGet 4.0+ can store all manifest metadata directly within a project file rather than using a separate.