Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a "packages" folder and how to make it work?

Tags:

c#

nuget

web

I have a WebSite project in VS2010. Folder structure is like:

../packages
../Website
../Website.DataAccess
etc.

I'm trying to open website by opening root folder in VS2010/Open Website. But when I do, it seems to have missing all the references, for example System.Web.Helper, System.Web.Mvc etc. Error messages like:

Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

keep showing up.

So why is there even this folder "packages"? Should it automatically let me open website project without worrying about all the references/assemblies?

Is there anything I should do to make the WebSite see the "packages" folder and use it, so I can build this WebSite?

EDIT 1: Also, when trying to install new package from nuget console: install-package system.web.helpers

I get error message: The current environment doesn't have a solution open.

Since this is a WebSite, I don't have a Solution file. Anyway, seems a bit weird to me, that solution file is needed.

like image 447
andree Avatar asked Aug 29 '12 14:08

andree


People also ask

What is a package folder?

Package Folders Packages are special folders that can contain class folders, function, and class definition files, and other packages. The names of classes and functions are scoped to the package folder.

Can I delete the .NuGet folder?

Yes, the . nuget folder is used as a cache for packages downloaded to speed up project restore and compilation. It can safely be removed.

What is Visual Studio packages folder?

Packages is where the nuget packages are fetched. No you do not ship to your IIS server. Actually there are a lot of files you don't copy. You should use visual studio to build a deployment folder, and only copy files from the deployment folder. Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM.


2 Answers

You may be talking about the NuGet packages folder which is created to store the links to the packages you have installed from the NuGet Package Manager.

enter image description here

Go to nuget.codeplex.com and click this button:

enter image description here

like image 95
Mr. Mr. Avatar answered Oct 06 '22 05:10

Mr. Mr.


You need to install the NuGet Visual Studio extension to begin with. You can get it directly within Visual Studio by going to Tools -> Extension Manager and searching online for NuGet - then installing it.

Once installed, you can manage the packages through it - right click on the project node in Solution Explorer and select Manage NuGet Packages... to get the UI.

Check out the answers on How do I get NuGet to install/update all the packages in the packages.config? for details.

like image 45
Oded Avatar answered Oct 06 '22 07:10

Oded