VS 2012 not using the dependencies downloaded by NuGet - visual-studio

I checkout a solution from a repo which is not owned by. The solution and/or the projects are not developed by me either. I follow this guide from here. This is the summary:
What worked finally was to
check Tools|Options|package manager|Package restore right-click the
solution and "enable package restore" right-click a project in the
solution and "Manage nuget packages". Then you will finally get a bar
across the top of this UI with a message that some packages are
missing, click to get them. Clicking this button gets the packages.
So, I click on restore and NuGet seems to download the packages. However, when I try to build the project, it still complains that the dependencies are missing. I look at the packages folder in the solution folder and see all the necessary dependencies. But, for some reason the project is not correctly linking to it.
In other words, Solution/packages exists with all the libs but when I try to build the solution and/or project, I get a build fail. Does anyone know what is going on?
Thanks.
EDIT: For clarification, under warnings, I get
Warning 18 The referenced component 'Microsoft.Practices.Unity' could
not be found. BlueFin
EDIT 2: For another clarification, if I add existing references and go to the packages folder packages/lib/thefile.dll, it will compile properly and work. The question is, nuget should be doing this automatically for me right?

Related

How to remove sqlite.net.platform.xamarinandroid from xamarin android project

I am trying to work on sqlite related operation's on my android project but in latest android version's getting fallowing exception i.e system/lib/libsqlite.so. Most of the post suggest to remove all sqlite pcl related packages and install latest sqlite.net.xamarinandroidN package. After installing they are mentioned remove old sqlite.net.platform.xamarinandroid dll but I am unable to remove that. I have go to my project references and unselect the xamarinandroid.dll and clean and rebuild then it's dll again added to the project automatically. Most of are mentioned that after removing that old dll only the newly installed sqlite is worked. Please suggest how can I remove old sqlite. I am using sqlite.net.xamarinandroidn and sqlite.net.pcl-async packages in my project.
Right click on your project.
Click on "Manage NuGet packages"
Open the "Installed" tab.
Hover over the package you want to uninstall, then click on the red X or you can click the Uninstall button that should be displayed on the Right.
I suggest deleting all the SQLite packages, then reinstall the ones you need.
And a tip:
This is the package you want to add (I found this in assembly references):
This is what the package will look like in your projects References once added:
Then these ones you can add through the NuGet Package Manager:

How to restore NuGet packages for vs2015 project

I just built a new PC, installed my dev tools, connected to TFS and downloaded my project. Now most of my references are broken to EF, jQuery, etc.
The packages folder is missing all the .dlls, if I try to use NuGet restore nothing happens. If I use NuGet manager for Solution there is no "force" reinstall option.
NuGet seems to be more a hindrance than a help.
You can run "Update-Package -reinstall" command from Package Manager Console in VS to force reinstall all the packages.
Package authors often need to reinstall the same version of package
they are developing to test the behavior. The command Install-Package
does not provide ‘-force’ option, that could forcefully reinstall a
package. So, Update-Package -reinstall is added to meet that
requirement.
I've had that same issue plenty of times when I need to re-download code after getting a new PC. Here's what worked for me:
Download the project from TFS (or in your case SVN).
Delete the "packages" folder
Make sure the "Package Manager Console" is enabled (Tools -> NuGet Package Manager -> Package Manager Console)
Open the solution file.
At the right side of the "Package Manager Console," a "Restore" button should appear. Click on the "Restore" button.
Hope that helps you.
I'm not sure if I'm supposed to share the link if I already answered a similar question or just answer again, so I'm doing both. Here's the link to the same answer from a different asker.
Edit:
If after you complete the above steps you are still getting syntax errors from missing references, right-click on References in the Solution Explorer and then just hit OK. That fixed the problem with the references for me.

Nuget Automatic Package Restore not working on project (.csproj) build (without solution)

We have a solution which contains several projects. Some projects have NuGet packages installed, for example Json.NET. The whole solution is checked in to TFS Version Control, without the packages folder. We have set up Automatic Package Restore according to the "Nuget 2.7+ method" as described in the Nuget documentation (actually we didn't set up that much since all this is enabled by default).
When we build this solution on another computer, all packages are getting restored.
When we build this solution on our TFS 2013 Build server, all packages are also getting restored.
Now here comes the problem:
When we create a build on our TFS 2013 Build Server which should build only one of the projects in the solution (so targeting the .csproj file instead of the .sln file) the nuget packages are NOT getting restored!
Can anyone tell me why this is happening, or tell me if this is by design? I really don't want to build the whole solution, since it is a release build for only a single small project, but i do want the packages getting restored automaticly...
I believe the Automatic Package Restore hooks into the Build Solution event. Since there's no solution, it's not triggering the restore.
To build a single project, you may need to create a new solution that references just that project.

NuGet downloads all packages, doesn't update references

I have my project set to Allow NuGet to download missing packages as well as Automatically check for missing packages during build in Visual Studio. In my solution folder, there is a packages folder and it contains everything that I need for my project. However the references to them in the project are still broken.
I have tried removing the references and adding them with NuGet, but NuGet says the item is already in the project (it is in the packages folder) even though the reference is there and the project can't build. The only way that I can seem to get around it is to manually go into each of the packages in the packages folder and select every .dll.
Is there a better way to do this?
Open package manager console and type:
Update-Package -Reinstall
This should refresh all your references based on each project's packages.config file.

NuGet Package restore for website

I am trying to use NuGet Package Restore with VS2010 + Visual Sourcesafe. It is working partially for me.
Where this is coming from: NuGet not getting missing packages
My Solution2 has asp.net website[Project1 in above image] that has another nuget package installed. Now another developer opens the Solution2 via VS2010, the automatic restore works for Library projects in Solution1. It gets all missing packages for Library projects that is referenced in this Solution2 and I see them in Solution1/packages folder.
But for Website it says external dlls i.e. pacakages missing. The issue I think is because website doesn't have a .csproj file and so it doesn't know things needs to be restored.(http://nuget.codeplex.com/workitem/1663)
Making it work partially:
Added packages/repositories.config to website solution (What is a solution folder in visual studio)
Another developer goes to VSS and get that packages folder manually. Now when he builds the solution, the Package Manager Console prompts for restore i.e. has "Restore" button. On clicking it will bring the AjaxControlToolkit.
Questions:
- Is the above approach the only and best available for Websites?
When the developer clicks "Restore" button it brings packages for Library as well to Solution1/packages along with packages for nuget. Any reason why would it do that?
Any ideas on above issues?
Per you link, nuget doesn't support websites. If you really need to use Nuget, and let's face it, everyone does, then in my opinion the best approach is to switch your website over to a web application, at which point visual studio will create a csproj file for you, detailing the nuget packages that are contained in the project.
HTH
For adding Solution level "packages" folder with repositories.config to VS Solution Explorer, I created a Solution folder and added repositories.config.
That created packages folder in the SourceSafe when I checked-in the solution.
I also found someone pointing the same thing here.
Update: I think the newer nuget is restoring the packages. But one other trick for nuget to add the dll to the bin folder it to check-in the .refresh files for AjaxControlToolkit and its dependent packages.

Resources