본문 바로가기

카테고리 없음

Unable To Restore Packages On Vs For Mac

Unable To Restore Packages On Vs For Mac
  1. Unable To Restore Packages On Vs For Mac 2017
  2. Unable To Restore Packages On Vs For Mac Pro
Restore

NuGet is great. So great, in fact, that I’ve in Azure to use during my personal development to share Common projects, etc. It’s insanely nice as now I can do my builds using packages from other VSO projects without any hassle. But for my own personal development, and likely any private NuGet dev that my readers might be doing, it makes some sense to not only deploy libs as NuGet projects, but also configure the applications that use them to pull the latest version of the libs at build time.

When you configure NuGet package restore for your project, what happens at build time is simply a download of the version specified in packages.config to the build location to be used to resolve references. It doesn’t grab any version other than that specified in that file. Unable to find version xxxx of package yyyy. The NuGet Visual Studio Extension and the NuGet PowerShell Console all have a configuration option specifying.

But NuGet doesn’t do this. By default, anyway;) When you, what happens at build time is simply a download of the version specified in packages.config to the build location to be used to resolve references.

Unable To Restore Packages On Vs For Mac 2017

It doesn’t grab any version other than that specified in that file. If you want to get a new version, you have to run the equivalent of ‘nuget update ’ before doing the build. But it’s not as simple as putting ‘nuget update ’ in the pre-build steps. So how can we make this happen? Sure you can add a new build step to your process – if you’re doing a big fat build server build configuration with TFS, etc. But what about on my local machine?

I want the update to take place on its own without me having to think about it, and also to find out if anything breaks when I get this new version – at a time when I’m able to fix it, not on the build server. Let’s have a look at a few snippets from the NuGet.Targets file that’s put in place when you configure package restore.

Seeing how this works? We’ve got a set of ‘Commands’ we’re going to run.

We define what they actually do, define the order of execution, then wrap that up in a ‘’ tag to be used by the MSBuild engine. So have a look at these apples.

Unable To Restore Packages On Vs For Mac Pro

Packages

On your physical disk you’ll see both packages show up in SolutionDir packages, but the end result is what you want. I tried ordering UpdatePackages before RestorePackages to avoid this quirk but I was met with errors, unfortunately. Best part is this works locally in your VS instance and on the build server when the build gets run.

Unable To Restore Packages On Vs For Mac