Reputation: 7164
When I'm trying to uninstall a NuGet package using NuGet Package Manager's graphical interface, I'm getting this error :
Object reference not set to an instance of an object.
I have tried many things in Package Manager Console, such as :
Uninstall-Package AutoMapper
or
Uninstall-Package AutoMapper -Force
I'm still getting the same error.
When I'm trying to update a package using this :
Update-Package AutoMapper
I get this :
Update-Package : An error occurred while retrieving package metadata for 'System.ComponentModel.Annotations.4.3.0' from source 'D:\folder\project\project\packages'.
Can you tell me how I can uninstall a package or make a modification on it? Thanks.
EDIT :
When I try to install Nuget Commandline like this :
Install-Package NuGet.CommandLine
I get this :
An error occurred while retrieving package metadata for 'AutoMapper.5.2.0' from source 'D:\folder\project\project\packages'.
Upvotes: 2
Views: 6923
Reputation: 4119
If you can't uninstall your nuget via package manager console or with Nuget Package Manager, you still have the option to go to your project. Open your package.config file.
Looks like this
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.4.1.9004" targetFramework="net452" />
<package id="bootstrap" version="3.3.2" targetFramework="net452" />
...
There you will find the id of your AutoMapper dependency with the version associated. Remove that line. Open your Nuget Package Manager again, and Install from there if you want to reinstall the package. If you want to remove it completely, then just update the package.config as I explained and you can also remove the folder of AutoMapper on your packages folder, but the later is not necessary, unless you don't wont to keep the package for a future use. Just removing the entry of the Id on your config files will work.
Upvotes: 5