What directory to extract Entity Framework 6 NuGet package to - nuget

I'm working in VS 2012. I just downloaded the Entity Framework 6 Alpha3 NuGet package.
I put it in the NuGet folder for quick access.
When I use the command
PM> Get-Package -Filter EntityFramework -ListAvailable
(and related filters 'EF6' and 'Entity')
I cannot find my download.
I can find
Glimpse.EF6. This is not what I'm looking for.
My path to the download:
C:\Program Files (x86)\NuGet\Visual Studio 2012\EF6 Alpha3
My question is where do I need to put the download file so that I can locate it when adding the solution to my project.
I understand how I will add the package to every solution I wish to use it in. I have read the MSDN and codeplex documentation.
I understand that I am merely looking for the package to add to my solution. This is my problem. I put it in the NuGet Program folder and am still unable to find this.
I am sure I'm missing something simple. I am just asking where to put the download of the Alpha3 version of EF6 so that I can locate it using the -ListAvailable command.
Thanks!

From what I can read from your question and comments, it seems like you are missing the basic understanding of how NuGet works and how to use it.
I would highly recommend that you start by reading some documentation about NuGet. The Getting Started page provides a brief introduction, and pay especially good attention to the section named Working with NuGet Packages.
docs.nuget.org is an extensive resource to everything you might need to know about NuGet. The first four links should provide you more than enough information:
Overview
Installing NuGet
Managing NuGet Packages Using The Dialog
Using the Package Manager Console
To answer your specific question about where NuGet packages gets download: the default location is in the packages folder at the root of your solution location. You should however not need to think anything about this, but instead read the above links to understad the basics of NuGet.

Related

Which Nugets (globally) referencing a specific Nuget

We decided to have more control about which Nuget packages are allowed in our projects in the company. For that we have to analyze our already used packages first.
Is there a way to find out a specific packages is used by whom (globally)?
For example I remember that Castle.Core is used in Ninject.Extensions.Factory. But which other nugets are using this?
I would like the functionality (for not only specifically Castle.Core) https://www.nuget.org/packages/castle.core/#show-github-usage, but showing the 250+ projects (again not only specifically Castle.Core, but a choosen package).
There are related questions, which are specific for one package. For example>
Which NuGet package contains System.Web.Optimization?
My question, if is it possible to generalize this kind of questions. If there is a tool available for that.

When do you need Microsoft.EntityFrameworkCore package?

I'm a bit confused concerning the usage of the different "Microsoft.EntityFrameworkCore.*" NuGet packages.
When you have a look at the official MS documentation (which can be found here: https://learn.microsoft.com/nl-nl/ef/core/get-started/install/)
They always talk about installation of a specific package, e.g. "Microsoft.EntityFrameworkCore.SqlServer", never about installing the main core package Microsoft.EntityFrameworkCore.
In my opinion, if you do not want the add any specific dataprovider, you only install "Microsoft.EntityFrameworkCode" and next load a specific dataprovider from configuration. For example if you want both support for SQLServer and Oracle. Is this the way i should see it, or is there any other reason(s) ?
Thx for any response.
Emmanuel Nuyttens

Using Cake (C# Make) to always get latest NuGet package version

Is it possible to use Cake to always get the latest version of a specific NuGet package? I know NuGet itself only allows you to set that at the base Nuget.config level. There are some internal packages that we would like to always get the latest version of (some of our database entities), while other internal packages we don't want to force a latest (our extensions package, for example). Right now we have to go through and manually update projects that rely on those packages, and I would like to automate those "always get latest" at build.
I don't see anything using any of the NuGet add-ins, but I am new to Cake so I'm hoping I am just missing something.
Has anyone had any luck using Cake to always retrieve the latest version on the feed for specific named packages, and just use the current packages.config version for the rest?
The short answer is that you can do anything that you want.
Cake out of the box will attempt to adopt established best principles for reproducible builds.
With the preprocessor directive, you could simply omit the version information, and Cake/NuGet will fetch the latest version. However, once downloaded to the tools folder, Cake/NuGet will not fetch it again. What you could do is add a custom step in your bootstrapper to clear the tools folder each time before build, and then the latest version will be downloaded each time.
Note: This is NOT a recommended approach, but rather something custom for your setup.

Why are some NuGet packages named with nuget-bot?

I went to add a NuGet package for Microsoft.TeamFoundationTracking.Client and in the list of available packages I have the options:
Microsoft.TeamFoundation.WorkItemTracking.Client
and
nuget-bot.Microsoft.TeamFoundation.WorkItemTracking.Client
The one with nuget-bot has a higher version number than the one without it. I don't ever recall seeing packages with the nuget-bot in the name. I assume there is some convention or format that this refers to.
Thanks for any explanation of what this means.
I'm not familiar with the nuget-bot packages, but if you are looking for official Microsoft binaries, you will want to look for those where the Owner is set to Microsoft (not just the author). The package you seek is most likely: Microsoft.TeamFoundationServer.ExtendedClient

nuget restore fails on build but works manually

VS 2013 fails to restore a package - the package contents are not materialized - although VS/nuget appears to think that it did restore the package successfully.
If I manually uninstall and re-install the same version of that package, it works as it should.
A bare-bones repro can be downloaded as a zip. This repro has a
single solution with a
single project with a
single file, "packages.config", specifying a
single package, "breeze.edmbuilder -version 1.0.4", containing a single file, edmbuilder.cs
single folder, "App_Start", contains nothing but
the .csproj says it should have "edmbuilder.cs" which is ok because
it WILL have "edmbuilder.cs" when the package is restored.
When I build, VS reports that "edmbuilder.cs" is missing ... and indeed it is missing.
However, the package was downloaded; I know this because the build produces a "packages" folder that contains "Breeze.EdmBuilder.1.0.4" wherein I see that "edmbuilder.cs" is present and in the right place.
When I issue the command install-package breeze.edmbuilder -version 1.0.4, nuget reports
'Breeze.EdmBuilder 1.0.4' already installed. NugetRestoreFail already has a reference to 'Breeze.EdmBuilder 1.0.4'.
There is nothing wrong with this package AFAIK. For when I uninstall-package breeze.edmbuilder and then reinstall with install-package breeze.edmbuilder -version 1.0.4, the install works and the missing edmbuilder.cs appears in the "App_Start" folder where it belongs.
The failure is repeatable in place.
close the solution
delete edmbuilder.cs from "App_Start"
delete the "packages" folder
optionally delete the .suo and bin and obj directories
re-open the solution and re-build
You'll get the same failing behavior ... and the same ability to manually uninstall and reinstall.
FWIW, removing the reference to edmbuilder.cs from the .csproj has no effect.
No matter what I do, I have to manually uninstall and re-install the package.
WTF!
p.s.: I am using VS 2013 Update 2 RC. I doubt that the "RC" matters as this problem came to my attention from a customer. You never know.
p.p.s: This is not about the build failing and I don't care that this solution would never run. What you see here is a stripped down version of a real app that would have worked. The only question is "why no restored file?"
Package Restore is NOT the same as installing a package. What you are seeing is by design. It simply downloads any missing packages in the packages folder. No more. No less.
Package Restore was added so you wouldn't need to commit the packages folder to source control.
It is expected that you would install a package then commit the changes made to your project files as well as any files that may have been added like your edmbuilder.cs, essentially anything inside your project folder. You would exclude the packages folder.
Now when you get the source from source control everything would be present except for the package files. Package Restore would download those and now your working copy is complete.
See NuGet's Restore Package insists on specific package versions
Is this stupid or what?
Thanks to #Kiliman for explaining that my horrible experience is "by design".
So how do you actually get the content you thought was being restored? Do you install each package one at a time. That's insane.
I was going to observe that there is no nuget equivalent of an npm install that would fetch all the packages you need ... when I discovered that there actually IS an almost-equivalent. It's just not obvious and I wonder how many people know it exists.
It's a two step process:
FIRST restore the missing packages ... THEN
Issue the command: Update-Package -Reinstall
This re-installs all packages in every project in your solution.
If you only want to re-install for a specific project, try:
Update-Package -ProjectName 'YourProjectName' -Reinstall
In both procedures, the -Reinstall switch strives to install the exact versions of the packages spelled out in your package.config ... and not newer "updated" packages which may or may not work for your project (but see the documentation for exceptions).
Read about update-package -reinstall in the official nuget documentation entitled, "Reinstalling Packages and its Pitfalls".
Do not miss the cautionary remarks. Clearly this technique is but an approximation of what you'd expect from other package managers.
Good luck, peoples.