Bug 23177 - Unable to add NuGet package again after removing it.
Summary: Unable to add NuGet package again after removing it.
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NuGet ()
Version: 5.4
Hardware: PC Windows
: Normal normal
Target Milestone: 5.7
Assignee: Matt Ward
Depends on:
Reported: 2014-09-19 05:38 UTC by Matt Ward
Modified: 2014-11-25 23:49 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Matt Ward 2014-09-19 05:38:30 UTC
To reproduce:

1) Create a new C# project.
2) Right click the project and select Add - Add Packages.
3) Add Json.NET
4) Close Xamarin Studio and re-open it.
5) Right click the project and select Add - Add Packages.
6) Add Json.NET again even though it is already added to the project.
7) Right click the Newtonsoft.Json under the Packages in the Solution window and select Remove.
8) Right click the project and select Add - Add Packages.
9) Add Json.NET

Expected result:

Json.NET NuGet package is added to the project.

Actual result:

NuGet package fails to be added. Error in Package Console:

Could not find a part of the path '...\MyProject\packages\Newtonsoft.Json.6.0.5\Newtonsoft.Json.6.0.5.nupkg'.

Workaround is to do a package version search "Newtonsoft.Json version:*" and then the Json.NET NuGet package can be installed.
Comment 1 Sadik Ali 2014-09-19 06:26:14 UTC
I have checked this issue and I am able to reproduce this issue.

To reproduce this issue, I have created a console project on XS and follow the same steps mentioned in bug description. I am also getting the same error. i.e.

 "Could not find a part of the path..." 

Note: After following steps mentioned in bug description, I am not able to add the "Json.Net" package from nuget in other solutions. I try to add same package to newly created solution  but not able to add that package. I am getting the same error. However, I am able to add other packages from nuget.

Screencast: http://www.screencast.com/t/pa0eFAM2

IDE logs: https://gist.github.com/anonymous/e2b51065ce34b8c07b6e
Package Console Info: https://gist.github.com/anonymous/c25142533af70075167b

Environment Info: 

Windows 6.2.9200.0 (64-bit)

=== Xamarin Studio ===

Version 5.3 (build 441)
Installation UUID: a7e29e93-6348-4126-9ebc-b2777c96a552
 Microsoft .NET 4.0.30319.18408
 GTK+ 2.24.22 (MS-Windows theme)
 GTK# 2.12.26

=== Build Information ===

Release ID: 503000441
Git revision: befb6aa1176d37a5f678f4274f340a0159091b7a
Build date: 2014-09-08 20:54:12-04
Xamarin addins: 6dc7c388e31fdfc8014689839d37de0d4622435c
Comment 2 Matt Ward 2014-09-19 08:08:04 UTC
This should be fixed in:

Xamarin Studio:
Commit: https://github.com/mono/monodevelop/commit/564851536536aa2a27b6f810d54cd6c5b51e74fe
Comment 3 Prashant manu 2014-11-25 23:49:25 UTC
Now we are able to add package again after removing it as per steps mentioned in description. 
Screencast: http://screencast.com/t/M23F8lKX4j3R

Environment Info:
Xamarin Studio
Version 5.7 (build 596)
Installation UUID: 9021cab7-54cb-4099-bb6d-b40439903e85
	Microsoft .NET 4.0.30319.0
	GTK+ 2.24.22 (MS-Windows theme)
	GTK# 2.12.26

Version: 5.0.0 (Business Edition)
Android SDK: E:\android-sdk
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: C:\Program Files\Java\jdk1.7.0_67
java version "1.7.0_67"
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

Build Information
Release ID: 507000596
Git revision: d996e9ba6874a0d64241e43e5e6b06322ce29c84
Build date: 2014-11-25 15:11:03-05
Xamarin addins: 8ca19707b41536a391f53364ee4ff9272711feb0

Operating System
Windows 6.1.7601.65536 (64-bit)