Let's say I have a windows forms application with a few Nuget packages that are important and need to be kept up-to date.
Is it somehow possible to update Nuget packages programatically from a non-development environment? With a non-development environment I mean a random user that is running the WinForms application (having it installed on their pc).
I've read some things about using nuget.exe, but updating the nuget packages should result in .dll files to be placed in the installation folder.
You can do that, but you should not do it. NuGet packages are development dependecies and not meant to be updated arbitrarily in an already compiled application or at the customer site, because
That being said, do not do it. Instead, follow a responsible software develpment cycle, where you update packages and test your application throughly before delivery and provide frequent updates of you whole application to your customers.
Nevertheless, for educational purposes, you can install packages locally with Nuget CLI tools, in this example
nuget.exe. You need to specify the package identifier, the output directory and the framework, likenet472for .NET Franmework 4.7.2. This will extract the contents, as well as the package itself to the output folder in the package folder structure that will not match your target directory structure. From there, you would need to copy the assets that you need into your install directory e.g. with a copy script. Apart from not being the right thing to do, this is very cumbersome and most likely deemed to fail.