Cannot add jquery using NuGet Package Manager in VS 2017 - visual-studio-2017

I tried to add jquery to an asp.net core project using NuGet Package Manager of Visual Studio Community 2017 (version 15.5.2), but there is no jquery js files added to my project. Here is the screenshot:
Tried with Bower Package Manager, then the files are downloaded to bower_components folder but not to wwwroot as many people said.
Same thing for jquery-ui, bootstrap, etc.
Anyone experienced the same problem. Is there any work-around?
BTW, this accepted solution doesn't work for me: Where are jQuery-UI scripts stored in MVC6 project?

For ASP.NET Core in Visual Studio 2017:
NuGet shouldn't be used for client-side libraries.
After that Bower was used for this purpose, but now it is deprecated.
Currently the supported tool for managing client-side libraries is LibMan. Here is very good explanation how to use it in VS2017.

Related

Files Not Appearing In Solution Explorer

I am using Visual Studio 2017. I created an empty ASP.NET Core Web Application, and then installed the nuget package for Bootstrap through the Nuget Package Manager Console and the bootstrap .css and .js files aren't showing up in the solution explorer. Is this a bug or is there more to using nuget?
the bootstrap .css and .js files aren't showing up in the solution explorer. Is this a bug or is there more to using nuget?
That because the usage of NuGet for css/javascript libraries is discouraged. You should use the npm (Node Package Manager) to add the JavaScript libraries instead of using NuGet. The newer project file formats, PackageReferences, only supports files that are in a contentFiles directory inside the NuGet package.
To use the package Bootstrap to the .net core project, you need to select your ASP.NET Core Web Application and add a new file to the project root. While in the template manager (Add->New Item...), search for "npm Configuration file":
Then edit the file and add your dependency, i.e.
package.json (npm) or bower.json:
"dependencies": {
"Bootstrap": "4.1.3"
}
Note: Once you save, the file will be downloaded in a directory named "node_modules`. This alone won't be enough, as the required files need to be copied over to wwwroot folder, where they can be accessed when the application runs.
For the detailed info, see NPM, BOWER, NUGET, GULP – The Four Horsemen of ASP.NET CORE Apps and ASP.NET Core 2.0 and the End of Bower.
Hope this helps.
Content in the NuGet file that gets put into your project is only supported with packages.config, which is not supported in .NET Core. PackageReferences do not support getting content from the package.
I'm not 100% sure, but I think the ASP.NET team's recommendation is to use the preferred distribution method of the content you want to use. I haven't kept up with web development trends, but a few years ago web content like bootstrap were distributed with npm, so that's my recommendation for you. Creating a new Angular JS app with Microsoft's new web app template includes a npm package.json, so I think using npm is a safe bet.

npm "install" location in Visual Studio; .Net Core app

I'm just starting to play with my first .Net Core applications and am trying to use npm for client-side libraries. They get added to node_modules but aren't "installed" to wwwroot.
My question appears to have been asked before without answers:
How do I include libraries that installed via NPM to my MVC project on Visual Studio 2017
I've tried to install cropperjs. That works insofar that the files are downloaded and added to the node_modules folder:
projectfolder
node_modules
cropperjs
dist
src
package.json, changelog, readme, license etc. files
Now how would I get these files into my wwwroot directory to use them? The documentation is slightly confusing I'm afraid.
Thanks for enlightening me!
Sorry, found the answers after seeing the list of "related questions" to my own.
apparently, it is indeed required to copy the required files and folders over to the wwwroot location.
These two questions yielded answers and comments that solve my question:
How to access node_modules folder from wwwroot in asp.net vnext project
How to use npm with ASP.NET Core

Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing new package

I get Package restore failed. Rolling back package changes for 'ConsoleApp1' while installing a new package. In particular I am trying to install the dropbox API, but I tried several other packages and get the same result.
I install by right clicking on the project and choosing Manage nuGet Packages... Then I select the package and click Install.
The NuGet is able to connect with the NuGet server as the package seems to download. The download information flashes on the screen pretty quick so I captured it with screen recording software to see if there were error messages. There were none.
I updated visual studio 2017 to latest patch level. My windows 10 machine is also at the latest level.
The project I am trying to install into is a freshly created Console App(.Net Core).
Here are the other questions I looked at:
Package restore failed. Rolling back package changes
does not have any responses because it is not a well developed question.
package restore failed rolling back package change for ' myproject' in vs 2017 .net mvc core project
Yet another poorly worded question with no viable answers.
Package restore failed. Rolling back package changes for 'myproject' in vs 2017 in MVC Core
That one is trying to update packages, not install new.
Nuget - Package restore failed. Rolling back package changes for 'WebApplication1'. 0
Seems to be for a custom package.
I am new to using Visual Studio.
To expand on #Michael Potter's answer, create a Console App (.NET Framework), NOT Console App (.NET Core).
The problem was that I am using Console App(.Net Core) Core is not compatible with Dropbox API.
I figured that out by opening NuGet Package Manager -> Package Manager Console and running Install-Package Dropbox-Api.
Then the error message about compatibility was on the screen plain to see.
To solve the problem I am switching to Console App (.Net Framework).
bring the version of the solution package to 1.1.3enter image description here

Lost project templates in VS2017

After installing latest update for VS2017, I lost almost all the project templates for starting new project. I get following message when starting new project.
I uninstalled and then reinstalled some “Workloads” using new installer without success.
After searching web for solution, I tried to install “NuGet Package Manager” using Extension manager, but seems there is no NuGet Package Manager for VS2017.
Any jugar/solution please?
Repairing VS2017 solved the problem. Is it not a very long route?

Not able to install NUnit 3 test adapter in Visual Studio 2013 Professional edition

I am starting to work on the Selenium Webdriver in C# using NUnit Framework. I watched a lot of videos for the best installation and configuration steps so that I don't need to bother much about checkin of everything into TFS. I am using Visual Studio 2013 Professional edition and .NET Framework 4.5. Below are the steps that I followed till now:
Created a new Unit test project in Visual Studio 2013.
By default, [TestClass] and [TestMethod] annotations got created and default using statement was present for Visual Studio Unit testing framework, but since I want to use NUnit framework I removed these two annotations.
I installed Selenium webdriver (version 3.0.1) by right clicking on the solution -> Manage NuGet packages for the solution option.
Installed NUnit (3.5.0) in the same way from Manage NuGet packages option
Tried to install the NUnit Test adapter from menu Tools → Extensions and updates → Online → searched for NUnit test adapter. Only one option, "NUnit Test Adapter", (version 2.0.0) is visible which is not correct. Ideally I should also see "NUnit3 Test Adapter" in the search result.
I tried to do install locally the latest version of NUnit package, but even that is not getting installed.
How can I do this?