I am trying to automate the process of installing nuget packages into new visual studio projects. My idea is to reduce the time it takes to source all the packages via the nuget
note that you cannot simply drop a pre-built packages.config
file into a new project and expect it to work. When installing, NuGet modifies the project file (.csproj
) to include references and uses packages.config
for downloading missing files (and update/conflict logic).
Using VS 2017 (released stable versions 15.2 and higher) and the PackageReference
style of referencing projects, you can simply drop a Directory.Build.props
file into the root of your solution containing all the projects you need: