Ok, this has happened before, I'm not sure what the deal is.
I go to install this nuget package- Microsoft.jQuery.Unobtrusive.Ajax
the package is installed "correctly" both using the command line and the GUI. But there is no scripts added to my project?
I had the same problem with MVC6 Grid. At least there I could hack the scripts in.
I found the actual script on Microsoft's CDN page so I can work around this...just wondering if I'm missing something.
Using Visual Studio 2017 and the Project is a Core 2.0 MVC project if that helps. Thanks.
Since the usage of NuGet for css/javascript libraries is discouraged. You should use
Bower
or thenpm
(Node Package Manager) to add the JavaScript libraries instead of using NuGet. The newer project file formats,PackageReferences
, only supports files that are in acontentFiles
directory inside the NuGet package.To use the package
Microsoft.jQuery.Unobtrusive.Ajax
to the .net core project, you eed to select your MVC project and add a new file to the project root. While in the template manager (Add->New Item...), search for "Bower Configuration File" or "npm Configuration file".Then edit the file and add your dependency, i.e.
package.json (npm) or bower.json:
Note: For package.json (npm), 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.