How can I determine what a package contains and whether it's stable and useful for my application?

The primary source for learning about a package is its listing page on nuget.org (or another private feed). Each package page on nuget.org includes a description of the package, its version history, and usage statistics. The Info section on the package page also contains a link to the project's web site where you typically find many examples and other documentation to help you learn how the package is used.

NuGet generally works for .NET languages and is designed to bring .NET libraries into a project. Because it also supports MSBuild and Visual Studio automation in some project types, it also supports other projects and languages to various degrees.

The most recent version of NuGet supports C#, Visual Basic, F#, WiX, and C++.

What project templates are supported by NuGet?

NuGet has full support for a variety of project templates like Windows, Web, Cloud, SharePoint, Wix, and so on.

How do I update packages that are part of Visual Studio templates?

Go to the Updates tab in the Package Manager UI and select Update All, or use the Update-Package command from the Package Manager Console.

To update the template itself, you need to manually update the template repository. See Xavier Decoster's blog on this subject. Note that this is done at your own risk, because manual updates might corrupt the template if the latest version of all dependencies are not compatible with each other.

NuGet command line

You are allowed to redistribute nuget.exe under the terms of the MIT license. You are responsible for updating and servicing any copies of nuget.exe that you choose to redistribute.

Is it possible to extend the NuGet command line tool?

Yes, it's possible to add custom commands to nuget.exe, as described in Rob Reynold's post.

NuGet Package Manager Console (Visual Studio on Windows)

How do I get access to the DTE object in the Package Manager console?

The top-level object in the Visual Studio automation object model is called the DTE (Development Tools Environment) object. The console provides this through a variable named $DTE. For more information, see Automation Model Overview in the Visual Studio Extensibility documentation.

I try to cast the $DTE variable to the type DTE2, but I get an error: Cannot convert the "EnvDTE.DTEClass" value of type "EnvDTE.DTEClass" to type "EnvDTE80.DTE2". What's wrong?

This is a known issue with how PowerShell interacts with a COM object. Try the following:

`$dte2 = Get-Interface $dte ([EnvDTE80.DTE2])`

Get-Interface is a helper function added by the NuGet PowerShell host.

Working with packages

What is the difference between a project-level package and a solution-level package?

A solution-level package (NuGet 3.x+) is installed only once in a solution and is then available for all projects in the solution. A project-level package is installed in each project that uses it. A solution-level package might also install new commands that can be called from within the Package Manager Console.

Is it possible to install NuGet packages without Internet connectivity?

How do I install packages in a different location from the default packages folder?

Set the repositoryPath setting in Nuget.Config using nuget config -set repositoryPath=<path>.

How do I avoid adding the NuGet packages folder into to source control?

Set the disableSourceControlIntegration in Nuget.Config to true. This key works at the solution level and hence need to be added to the $(Solutiondir)\.nuget\Nuget.Config file. Enabling package restore from Visual Studio creates this file automatically.

Why do I get an "Unable to resolve dependency error" when installing a local package with remote dependencies?

You need to select the All source when installing a local package into the project. This aggregates all the feeds instead of using just one. The reason this error appears is that users of a local repository often want to avoid accidentally installing a remote package due to corporate polices.

I have multiple projects in the same folder, how can I use separate packages.config files for each project?

In most projects where separate projects live in separate folders, this is not a problem as NuGet identifies the packages.config files in each project. With NuGet 3.3+ and multiple projects in the same folder, you can insert the name of the project into the packages.config filenames use the pattern packages.{project-name}.config, and NuGet uses that file.

This is not an issue when using PackageReference, as each project file contains its own list of dependencies.

I don't see nuget.org in my list of repositories, how do I get it back?

What are the default license terms if a package doesn't provide specific license information?

Each package is governed by the terms that are included with the package. You should review the applicable terms before accessing, downloading, or acquiring any packages. On nuget.org, use the License Info link on the package page.

If a package does not specify the licensing terms, contact the package owner directly using the Contact owners link on the nuget.org package page. Microsoft does not license any intellectual property to you from third party package providers and is not responsible for information provided by third parties.

Managing packages on nuget.org

Can I edit package metadata after it's been uploaded?

NuGet recommends all packages to be signed. A design principle of package signing is that signed package content must be immutable, which includes the nuspec. Editing the package metadata results in changes to the nuspec, invalidating existing signatures. We recommend modifying existing workflows to not require editing the package metadata after the package has been created.

Note that dependencies listed for your package are generated automatically from the package itself and cannot be edited.

In addition, uploading packages to int.nugettest.org is a great way to test and validate your package without making a package available in the public gallery.

Is it possible to reserve names for packages that will be published in future?

Yes. You can reserve IDs for packages on nuget.org by requesting a package ID prefix for your account. In order to request a package ID prefix, follow the instructions in the documentation.

How do I deal with a package owner who is violating my software license?

We encourage the NuGet community to work together to resolve any disputes that may arise between package owners and the owners of other software. We have crafted a dispute resolution process to follow before asking nuget.org administrators to intercede.

Note that packages uploaded to int.nugettest.org may not be preserved.

What is the maximum size of packages I can upload to nuget.org?

nuget.org allows packages up to 250MB, but we recommend keeping packages under 1MB if possible and using dependencies to link packages together. As a rule of thumb, packages contain only one assembly to avoid collisions.

NuGet uses HTTP to download packages, so larger packages have a higher likelihood of failed installs than smaller ones.

It is possible to share dependencies between multiple packages, making the total download size for consumers of your NuGet packages smaller.

Dependencies are mostly static and never change. When fixing a bug in code, the dependencies may not need to be updated. If you bundle dependencies, you end up reshipping larger packages every time. By splitting NuGet packages into related dependencies, upgrades are much more fine-grained for consumers of your package.

nuget.org not accessible

Why can't I download packages from or upload packages to nuget.org?

First, make sure you're using the latest versions of NuGet. If that version continues to fail, contact support and provide additional connection troubleshooting information including:

The version of NuGet you're using

The package sources you're using

A restore log with detailed verbosity

MTR or a Fiddler traces (see below)

Your geographical area

Whether your machine is behind a proxy or firewall?

Is your machine located on a cloud providers' data center (Azure, AWS etc)? If yes, please provide the name of the provider and the region.

What is the API endpoint for nuget.org?

To use nuget.org as a package repository with NuGet clients, you should use the following V3 API endpoint:

https://api.nuget.org/v3/index.json

Older clients can still use the V2 protocol to reach nuget.org. However, please note, NuGet clients 3.0 or later will have slower and less-reliable service using the V2 protocol:

https://www.nuget.org/api/v2 (DEPRECATED!!!) Note: use "www." for the best reliability.

nuget.org account management

How to create a new nuget.org account?

To create a nuget.org account, you need to have a personal Microsoft account (MSA) or an Azure Active Directory (AAD) account. If you do not have one, you can create one. Follow the following steps if you have a MSA or AAD account.

Please accept the permissions to be given to the NuGet.org application.

You will be redirected to nuget.org, and asked to register a username.

Specify the username in the input box. Please note that the username is case sensitive and cannot be changed/renamed later.

Click on Register button.

You now have a nuget.org account. You can perfrom account management on the account settings page.

How to recover nuget.org password login?

Please note that the nuget.org Password login has been discontinued and the only way to log in to nuget.org is with a personal Microsoft account (MSA) or Azure Active Directory (AAD) account. However, in case you are unable to access your associated MSA/AAD accounts you might need to use password login for recovering your nuget.org account. In this situation follow the steps below.

Requirement: You will need to have access to the email that is associated with the account for which you need to recover the password.

This will show you the pop-up dialog box for assistance. Follow the steps in this dialog box to understand the associated Microsoft account(s) for your nuget.org account.

How to change the Microsoft account I use for nuget.org login?

If you wish to change the Microsoft account for nuget.org user, follow the steps below. Lets say your Microsoft account with email account1@outlook.com is associated with your nuget.org account with username MyNuGetAccount. You wish to change the login to another Microsoft account with email account2@outlook.com

Please sign in using currently associated Microsoft account i.e. account1@outlook.com on the login page after clicking Sign in with Microsoft.

Expand the section for Login Account. Click on the Change Account button.

You will now be redirected to the microsoft login page. Please sign in with the account that you wish to change the association to i.e. account2@outlook.com. Note: you might need to click on Sign out and sign in with different account during the sign in flow to be able to login with a different Microsoft account.

Failed to update the Microsoft account with 'account2 account2@outlook.com'. This could happen if it is already linked to another NuGet account. Contact support for more information.

Once you have successfully signed in with your second account, you will be redirected back to your nuget.org account settings page and you should now see the new Microsoft account associated as the login account. Going forward you should use this account when signing into nuget.org.

Microsoft account is linked with another nuget.org account.

If you tried changing your Microsoft login and saw the error below:

Failed to update the Microsoft account with 'account2 account2@outlook.com'. This could happen if it is already linked to another NuGet account. Contact support for more information.

Lets say you were trying to change Microsoft account login from account1@outlook.com for nuget.org user with username MyNuGetAccount1 to another Microsoft account with email account2@outlook.com. And you see the error above.

What does the error above mean?

It means that there is another nuget.org account which is associated with the Microsoft account that you are trying to change it to i.e. in above example the Microsoft account with email <account2@outlook.com> is associated with another nuget.org account with, say, username MyNuGetAccount2.

You cannot change the associated login with a Microsoft account that is linked to a different nuget.org account.

I forgot I had another nuget.org account, how do I find out which nuget.org account it is?

Login with the second Microsoft account on the login page. This will log you into the nuget.org account that is currently associated with the second Microsoft account. You can then view the uploaded packages and perform account management on this account.

I do not care about this second nuget.org account, I want to change my login for first nuget.org account with the second Microsoft account. What do I do?

If you wish to not care about the second nuget.org account and still want to re-use the associated Microsoft account with email account2@outlook.com.

You can release the association between the Microsoft account and nuget.org account by deleting the nuget.org account.

Follow the steps to delete user for the second nuget.org account MyNuGetAccount2.

Wait, I care about this second account too. I do not want to lose this account but change my associated account logins for first account.

You will need to create/use a third Microsoft account, say, with email account3@outlook.com.

First you should login with your second Microsoft account, account2@outlook.com on nuget.org. Follow the steps above to change associated logins and associate the third Microsoft account with this nuget.org account.

Once done, your second Microsoft account with email account2@outlook.com is free to be associated to your first nuget.org account, MyNuGetAccount1. Follow the same steps above to change microsoft logins to the second Microsoft account.

Signing in with Microsoft account shows me my email is linked to another Microsoft account

If you tried to sign in with your Microsoft account, say, with email account1@outlook.com and you see an error like below:

The account with email 'account1@outlook.com' is linked with another microsoft account.

If you would like to update the linked Microsoft account you can do so from the account settings page.

What does the error above mean?

When an account is created on nuget.org, there is a communication email address associated with that account. This is usually same as the email address that is used for associated Microsoft account. However, you could choose to specify a different email address for communication. So, technically, you could have a different Microsoft account, say with account2@outlook.com that is linked to nuget.org account with communication email address as account1@outlook.com.

So the error above means that there already exists nuget.org account with communication email address account1@outlook.com but is associated with another Microsoft account with email that is notaccount1@outlook.com.

How do I find which Microsoft account is linked to this nuget.org account?

You should use the sign in assistance flow to figure out which Microsoft account is linked to the nuget.org account with the email address account1@outlook.com.

Unable to use microsoft login, how do I recover my nuget.org account?

If you tried using the sign in assistance and you do not have access to the Microsoft account that is associated with your nuget.org account, please follow the steps below to link a new Microsoft account to your nuget.org account.

Requirement: You will need an access to a Microsoft account(which is not associated with any existing nuget.org accounts). If you do not have one, you can create one.

Once logged in, you will see the popup dialog show up like below. This is the password discontinuation dialog box.

NOTE: Please ignore the instruction to login with the specified Microsoft account. You can now link your nuget.org account to any other Microsoft login.

Click on the button Sign in with Microsoft and login with the Microsoft account that you have an access to, as mentioned in step 1.

Your account will now be linked to the new Microsoft account, which you can use to log into nuget.org going forward.

How to transform my nuget.org account to an organization?

If you want to transform your account to an organization, and this account is already associated with a Microsoft account login, please follow the steps given in the documentation for organizations on nuget org.

If however, your nuget.org account is not associated/linked with a Microsoft account, you can follow the steps below to transform this account to an organization.

Requirement: You need to have an individual account first created on nuget.org to be used as an admin on the org account. If you do not have one, please create a new nuget.org account

Specify the admin username for your personal nuget.org account/the account you created in Step 1.

Follow the instructions to complete transformation of this account to an organization.

nuget.org login issues for AAD accounts with unmanaged tenant?

If you see an error like below during your login flow with your email account domain(@yourdomain.com), see the steps below to recover your nuget.org account.

What is this unmanaged state thing during login? And why is this happening now?

Your account seems to be previously registered as a personal Microsoft account and it worked fine, however, now it seems like your account has been registered as an "Unmanaged" tenant in the Azure Active Directory (the identity service which we use to authenticate Microsoft accounts).

This could have happened if you or someone from your organization(with @yourdomain.com email address) registered with one of the AAD integrated services or did a self-service signup for Azure Active Directory, which creates such an "Unmanaged" tenant for the used Microsoft account domain(@yourdomain.com in your case).

What can I do to recover my account?

At this moment there is not a way for us (nuget.org) to authenticate accounts with such "Unmanaged" tenant accounts in Azure Active directory. We are looking in to a better way to authenticate such accounts.

If you want to login to nuget.org with your Microsoft account(@yourdomain.com), you(or an administrator at your company) will need to claim the ownership of the AAD by doing a DNS validation to authenticate users with email address "@yourdomain.com". Please follow the steps for domains admin takeover documented by the Azure Active directory. Once this is done, your normal login should start working.

I don’t want to do all that, what is the other way to recover my account?

How do I change my nuget.org account username?

You cannot. As a matter of policy we do not allow the change of usernames as of yet. The only way to change your username is to create a new account with the desired username. We recommend you delete your existing account before you create a new one, otherwise you will not be able to reuse your registered Microsoft account.

Important

Deleting the user will still reserve the username. You will not be able to reuse the same username again and this includes the change of casings. As an example if you created a user with username mycoolname and you want to change this to MyCoolName(casing changes), it will not be possible after deleting the user.

How to delete my nuget.org account?

To delete your account, please note that we recommend that you transfer the ownership of any packages where you are the sole owner. You can read more about managing package owners on how to do it. This will also help us expedite your request.

Important

Deleting the user will result in following:

Revoke associated API key(s).

Remove the account as an owner for any child packages.

Dissociate all previously existent ID prefix reservations with this account.

Remove the account as a member of any organizations.

Your username will be reserved and no one will be able to re-use it again without our permissions.