Nuget Package Custom Visual Studio Destination Folder - visual-studio

This is an issue I am having with most js/css nuget packages but I'll use JQuery as an example here.
When I install the nuget package for JQuery, it installs the JQuery js file(s) into the "Scripts" folder in the solution.
I have a custom folder (~/Assets/Js) that I want them to go into for better organization.
Obviously I can drag them into that folder and rearrange them manually but its annoying having to do that every time I update or install a new nuget package.
Is there a way for me to specify a custom nuget destination folder for a package?
Thanks in advance!

No,
without changing the package before installing, you can't change that destination.
It's a choice made by the developer of the package.
If you want a wild idea for a solution, download the code for the Nugget manager and add custom code for
your development environment ( but this is overkill for your annoyance...)
JQuery is open source.
--> Maybe propose a change to the guys who maintain JQuery...

Related

How do i install a package I downloaded manually into visual studio?

I dont do this very often so excuse me the question is so basic.
I found an example of parallax effect online I wanted to test.
called paroller.js
So the site offered for me to download their package and I did, its now on my desktop.
And now I have no idea how to include this in my solution, I went to nuget package manager to search for it, but cannot find it.
Link to where i got it from: https://tgomilar.github.io/paroller.js/
I tried using the nuget package manager, and I googled a million different ways to install packages into solutions and all want me to use the package manager
The only thing that nuget does is to download the files build them ( if needed) and add the required references. So, you apparently want to add a js lib. You should look for the dist folder in the package that you want and import it in your page.
Note if there is not dist folder you may need to build the package which is not that simple.

Using Nuget on VS2015 RC Tools for Apache Cordova

Bit of a newbie to VS2015RC with Cordova but I have a query regarding how to use Nuget to add dependencies like say Jquery, Angular etc.
If you add the dependencies or packages using Nuget then they are added to the root of the Project (Not in the www folder). Of course you can just move the files but this plays havoc with some of the Source Control we are using and also you have to remember to move it back again to the root if you want to "Upgrade" the dependency or package with Nuget again.
So....
Is there a way of getting Nuget to install the files in the correct
sub-folder? or...
Is there another way to add the dependencies /
packages (Npm etc?) and is there a tutorial around for that?
Thanks in advance for the help.
The way I understood it, the directory structure was changed in the RC. I chalked the wrong directory up to the nuget configs not being updated yet. I expect the gold release to have that fixed.

Dissociate files from Nuget without removing from the project

I have a project with a few front-end frameworks obtained via and managed by Nuget (Twitter Bootstrap, jQuery, jQuery UI ...).
I want to keep the files in my project, but remove them from Nuget's grip (I don't like the way Nuget organizes these files).
When I un-check the project for a library Nuget removes all the files it had installed, unless I've editted them (e.g. I over-wrote bootstrap.css with a customized version from getbootstrap.com).
As I do this from time-to-time, instead of backing up the /Content and /Scripts directories and adding back in the relevant files after removing the library from Nuget, I'd like to be able to dissociate all files of a particular library from Nuget at once without removing them from the project's directories. Is that possible, by either the GUI or the console?
I don't know if this issue is specific to a version(s) of Visual Studio, but mine is VS 2012
Can you elaborate for the part of "I don't like the way Nuget organizes these files"? If you remove NuGet from the picture, the good things that it does for you (detection of package updates, automatic package restore etc.) will be gone.
If you absolutely need to do this, one possible hack would be deleting packages.config from the project.

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.

Custom install path for Nuget Packages in VS with Content like JS files

I was thinking of using Nuget to pull in some JS libraries and the only issue I have is I use a custom path for my JS files. Is there a way to tell NUget in VS to put the package in a set path?
Nope, this isn't supported today, though there's been many discussions about this here http://nuget.codeplex.com/discussions

Resources