Since I am using CI integration I cannot (and don't want) to put packages to shared user folder. Instead I want them restore inside the actual folder (think node_modules).
So that is simple, I run dotnet restore --no-cache --packages Packages
and it works fine. Packages are restored and they are in the correct folder.
However when I run dotnet build -c Release
or dotnet run -c Release
it cannot find no packages.
/var/www/website/project.json(15,50): error NU1001: The dependency Microsoft.AspNetCore.Hosting >= 1.0.0 could not be resolved.
So how to make sure dotnet knows where to look for packages for this specific project?
Here is how my folders look like where I execute the commands.
bin
bundleconfig.json
NuGet.config
Packages
project.json
Properties
web.config
bower.json
Controllers
obj
Program.cs
project.lock.json
ViewsWeb.xproj
Okey, so for now there is no such option and actually --packages
seems to be some legacy parameter.
Anyway, in order to make it work we need to set env variable NUGET_PACKAGES=/var/www/website/Packages
Of course this sucks in a way that I cannot set it globally, however I can set it per process (if, for example I start app with systemd).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With