Dropzone.js Installation with NuGet Package Manager in Visual Studio 2019 - dropzone.js

I've "Installed" the Dropzone.js package through package manager in Visual Studio 2019 for a project in asp.net core 2.2. However, I'm not finding the js file anywhere in the project tree, nor does dropzone seem to be functioning in any manner. Do I have to ignore the nuGet package and just download the js file manually? Or is there something else I'm missing?
I was able to make it work by downloading dropzone.js (and associated files) directly from the dropzone repository. Just not through the NuGet package.
Thanks,
Owen

Related

How to install and use the latest Bootstrap in an MVC5 project?

I'm trying to use Bootstrap in my ASP.NET MVC5 project (I'd like to use .NET 5, but Visual Basic is not fully supported yet.)
I installed the latest NuGet package, but no folders/files were added to my project—only the package itself under the References node.
I found this extensive answer, but it's somewhat dated and it addresses a project architecture of ASP.NET Core. I added the suggested Package.json file, but no folder node_modules was added anywhere in my project.
How do I get started using the Bootstrap NuGet package in my MVC5 project?
--EDIT--
I'm using PackageReference, not Packages.config.
For Bootstrap is a client-side library,If you download by Nuget Package Manager, you can find it in the %UserProfile%\.nuget\packages directory. You could copy and paste it to your project.
Actually I suggest you could use LibMan for client-side library.
Here is the steps you could follow:
Create the folder wwwroot/lib;
In Solution Explorer, right-click the project folder in which the files should be added. Choose Add > Client-Side Library.
Search for bootstrap#5.0.2 like below:
Click the Install button to download the files.
Reference:
Use LibMan with ASP.NET Core in Visual Studio
Note:
The js and css are in wwwroot/bootstrap/dist/.

Nuget Packages not installing anything in .net core app

I am trying to install knockoutjs and typescript in a .net core app via Nuget.
It shows in Packages but doesn't install anything in a scripts folder as has previously in asp.net.
What am I missing?
TL;DR ASP.NET Core no longer works in that way (packages copying javascript/css content into your project). You need to adapt your workflow.
.NET Core projects only work in SDK-style projects, and SDK style projects only use NuGet's PackageReference, not packages.config. The docs on migrating from packages.config to PackageReference list one package compatibility issue as not supporting the content folder, which is how in packages.config those assets are copied into your project on package install.
I can't find a doc listing recommendations for ASP.NET Core apps, but my understanding is you can either use LibMan, or use NPM, which is in line with basically the rest of the web development industry outside of .NET has been doing. If you use the new project templates to create a new ASP.NET Core Angular or ASP.NET Core React app, you'll see they create a ClientApp folder that uses npm and all the official react/angular CLI tools. The MVC template has copies of jQuery and bootstrap, without an obvious way how to update them.
might be some unsync, remove the packages folder from the solution and restore the packages again. It will fix the issue. Also check the output window, that will show the list of errors.
It shows in Packages but doesn't install anything in a scripts folder
as has previously in asp.net.
First, I agree with zivkan. It is a feature of PackageReference Nuget Management format.
VS has two format to manage nuget packages: Packages.config and PackageReference.
Since new sdk format projects(Net Core and Net Standard) only use PackageReference to manage nuget packages,it will be very different from the effect reflected by the packages.config package management format.
When you use Content files from the nuget packages with PackageReference, it will lose files from the Scripts folder.
Just as this document said, it has such compatibility issues.
Actually, you can enter C:\Users\xxxx\.nuget\packages\knockoutjs\3.5.1 and find there is a folder called Content, Nuget will copy the content of that folder into your project when you install this nuget package.
But Content folder can be recognized by Packages.config format, and as far as I know, ContentFiles folder is used in PackageReference to add the content into your project. So in your situation, the nuget package should include ContentFiles folder at the same time. See this official document.
But the knockoutjs nuget package does not have contentfiles folder. That is why net framework projects with packages.config has the content files while new sdk projects does not have it.
And this behavior change can only be effective when you create the nuget package, so you ca n’t make any kind of change, you can only contact the author of the package to make this modification, and let him add this function as soon as possible to apply to the new SDK format project.
Suggestion
So So for now, you can try these:
1) you can either manually Add the content file from C:\Users\xxxx\.nuget\packages\knockoutjs\xxxx\Content to the project by Adding Existing Items.
2) roll back to use Net Framework projects with packages.config.
3) contact with the author on this link.

Visual Studio Code - Not able to upload nuget packge that is created locally on my computer

So I have written two programs(Main program and Calculatorlib) on Visual Studio Code where I have created package locally for one of the programs(Caluclatorlib)by using the command dotnet pack.
The package Calculatorlib_package.3.0.0.nupkg is created locally.
However I want to upload this package on visual studio code from my local computer so that I can give Package Reference to Main program.
I don't see any options to upload this on visual studio code.
But in Visual studio I see there is an option called "Manage Nuget packages" where we can go and upload locally created packages.
Can someone guide me how to do this?
Try adding your local package location as a Nuget package source. You should be able to add a Nuget package source using the package configuration , and add the location of the directory when you have the Nuget package locally.

How do you clear Visual Studio's object browser cache?

We have a library project that we are working on, and in a different project I have the feature branch installed as a Nuget package. Changes are being made on the branch, but version number isn't being updated, so the Nuget package is getting updated, but it has the same name.
I've deleted the Nuget package from my packages folder, so I know I am downloading the latest, and if I manually browse (in the Object Browser) to the dll that I have downloaded to my packages folder, the Object Browser data looks correct.
I've uninstalled and reinstalled the Nuget package in my project, I've turned off all instances of Visual Studio 2017, but still old items are persisting in the Object Browser for my dll that I have installed through Nuget. I am expecting to have build failures because I'm referencing old items, but everything builds successfully, but then when I run the application I am getting run time errors because the old items I am referencing in code no longer exist in the dll that is currently downloaded.
It would be nice if we didn't have to bump version for every build, although we could set up TeamCity to do that automatically, but it would become difficult to maintain all of the extra Nuget packages in our feed.
So, short of just bumping version numbers on the dev Nuget packages, is there any way to clear the cache in Visual Studio 2017 so that the Object Browser updates to reflect the dll that is actually in the packages folder?
I found the problem. In the project where I was testing the library, I had a wpf project and a library project targeting .Net standard. Since the project I was actively working on was wpf I was zoned in on the packages folder in the solution directory, and forgot I was also referencing .Net standards in the same solution which pulls Nuget packages from C:\Users\[username]\.nuget\packages
Because of the project types, Visual Studio had two locations for Nuget packages. One at C:\Users\[username]\.nuget\packages and one at [solution dir]\packages
I updated only the solution directory packages, but apparently Visual Studio 2017 favors the use of the user directory packages, and that is where it was pulling the old API information. After deleting the package from my user directory everything is working as expected.

Even with Nuget.exe 4.1.0 - Serilog already has a dependency defined for 'Microsoft.CSharp'

I know there's an answer for this question from 2016 but it's not working today. I have VS2013 with the latest CU installed.
My Nuget package source settings:
I want to install the nu-get package "Serilog.Sinks.MSSqlServer". First, I ensure nuget is up to date by navigating to the ".nuget" folder of the solution's folder and running "nuget update -self":
Unfortunately, I still get the error when trying to add the package:
If I try to update nuget from the "Extensions and Updates" page of VS then I get a 403 error as shown below:
The 403 does suggest a proxy issue but other packages can be installed to the same dev box ok. I just installed "Apache log4net" from the Manage NuGet Packages window - no problem
Any ideas of a work-around for this please?
This might be related to the fact that you now (with the new NuGet CLI tool version) need to use the new NuGet API.
from nuget.org
NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): https://api.nuget.org/v3/index.json
NuGet feed v2 (VS 2013 and earlier / NuGet 2.x): https://www.nuget.org/api/v2
You can check (and edit) your NuGet Package Sources under Tools, Options, NuGet Package Manager, Package Sources.
#Rob Bowman, in response to your comment and looking at the screenshot of your Available package sources, try edit your default nuget.org to https://api.nuget.org/v3/index.json or add a new source and make sure they're both enabled. Maybe that'll do the trick.
Update: maybe manually updating the NuGet Package Manager (since updating it through Extensions and Updates is not working) solves the problem. NuGet Package Manager for Visual Studio 2013.
Going to Visual Studio menu Help, About should display the currently installed version of this extension (and others).
To fix this I had to:
logon to a PC not connected to the corporate proxy
download the latest version of the nuget package manager (VSIX) for VS2013 from https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManagerforVisualStudio2013
copy the VSIX to my corporate dev VM and install

Resources