Home: closed - not nuget issue - needs fix from xamarin -- [vsfeedback] Nuget get error "This collection is read-only" while install/restore package

Created on 19 Jan 2018  ยท  64Comments  ยท  Source: NuGet/Home

The problem with some package that contains dependencies like Xamarin.Forms

_This issue has been moved from https://developercommunity.visualstudio.com/content/problem/169526/nuget-get-error-this-collection-is-read-only-while.html
VSTS ticketId: 541086_
_These are the original issue comments:_

Ankit Mishra [MSFT] on โ€Ž12โ€Ž/โ€Ž18โ€Ž/โ€Ž2017, 06:23 PM (31 days ago):

Thank you for your feedback! For us to investigate this further, could you please provide the following -


  1. A sample project that has this issue.
  2. Exact repro steps on that sample project that we could use to repro this problem.


We look forward to hearing from you!

Darrell Tunnell on โ€Ž12โ€Ž/โ€Ž19โ€Ž/โ€Ž2017, 06:45 AM (31 days ago): Trying to update some nuget packages and am getting this error.I have attached image of output.
Samantha Houts [MSFT] on โ€Ž12โ€Ž/โ€Ž20โ€Ž/โ€Ž2017, 08:09 PM (29 days ago):

I got this with

https://developer.xamarin.com/samples/xamarin-forms/TodoLocalized/

Update the Android project's compile version to 8.0 first, then try to update the Xamarin.Android.Support libraries.

Ibrahim Cohen on โ€Ž12โ€Ž/โ€Ž26โ€Ž/โ€Ž2017, 00:17 PM (24 days ago):

Getting the same error while attempting to update xamarin packages, also getting:
SeverityCodeDescriptionProjectFileLineSuppression State
ErrorThis project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packagesXamarin.Android.Support.v4.26.1.0.1\build\MonoAndroid80Xamarin.Android.Support.v4.targets.SolutionName.AndroidC:\Workspace\Sample\App Test\SolutionName\SolutionName\SolutionName.Android\SolutionName.Android.csproj383

_These are the original issue solutions:_

Hines Vaughan solved on โ€Ž12โ€Ž/โ€Ž26โ€Ž/โ€Ž2017, 00:37 PM (24 days ago), 1 votes:

Was receiving this issue as well just now. Went into VS settings -> NuGet settings -> cleared the NuGet cache, closed Visual Studio, and then I deleted all obj and bin folders.

Ibrahim Cohen solved on โ€Ž12โ€Ž/โ€Ž26โ€Ž/โ€Ž2017, 00:54 PM (24 days ago), 0 votes:

That worked, thank you Hines Vaughan!!

Ignacio Ortiz solved on โ€Ž1โ€Ž/โ€Ž10โ€Ž/โ€Ž2018, 10:04 AM (9 days ago), 0 votes:

What worked for me was this:

1. Deleted Nuget Cache on VS.

2. Opened packages folder and deleted all packages and dependencies manually.

3. Same thing with .csproj file and packages.config files.

4. Reloaded the project again and started to install one by one the dependencies starting for the dependencies that didn't have any subsequent dependency. I installed using Nuget Package Manager and got the famous error "This collection is read-only", then simply clicked again in INSTALL in Nuget and the second time it installed correctly. It's important to verify no traces of previous versions or wrong dependencies are in packages folder, packages.config file and .csproj file.

That's it. Hope it helps.

Paul Diston solved on โ€Ž1โ€Ž/โ€Ž12โ€Ž/โ€Ž2018, 07:15 AM (7 days ago), 0 votes:

I am experiencing this problem again today however clearing the NuGet cache, deleting all obj and bin directories and clearing the Packages directory do not seem to be working.

Update: After further investigation, I have got the This collection is read-only because I was trying to install Xamarin.Forms via NuGet however the reference was already added after I added a reference to another project that already had Xamarin.Forms installed.

Paul Diston on โ€Ž1โ€Ž/โ€Ž12โ€Ž/โ€Ž2018, 08:10 AM (7 days ago):

Update 2: The above update seems to be incorrect, I am still getting This collection is read-only, even when the project I am trying to install Xamarin.Forms into does not reference other projects.

Hines Vaughan on โ€Ž1โ€Ž/โ€Ž12โ€Ž/โ€Ž2018, 08:36 AM (7 days ago):

Have you tried using Package Manager Console window instead of the normal NuGet GUI window in VS? I can't remember exactly but I know some people had success with Package Manager Console while the normal NuGet GUI window was failing.

Darrell Tunnell on โ€Ž1โ€Ž/โ€Ž12โ€Ž/โ€Ž2018, 09:30 AM (7 days ago):

I have tried using package manager console. I get the same issue. It seems to fail on the Xamarin.Forms package - here is the log output around the issue:

>

Successfully installed 'Xamarin.Android.Support.v7.MediaRouter 26.1.0.1' to Todo.Android
Adding package 'Xamarin.Forms.2.5.0.122203' to folder 'C:\Users\darrell.tunnell\Source\Repos\Gluon.Client.Jwt\src\packages'
Added package 'Xamarin.Forms.2.5.0.122203' to folder 'C:\Users\darrell.tunnell\Source\Repos\Gluon.Client.Jwt\src\packages'
Install failed. Rolling back...
Package 'Xamarin.Forms 2.5.0.122203' does not exist in project 'Todo.Android'

1 External

Most helpful comment

Well, for me it was solved by updating the packages one by one, setting the dependencies option to "None"

All 64 comments

It's a very annoying issue, I can't update any component in my xamarin project.
Also Xamarin team is tracking it here https://bugzilla.xamarin.com/show_bug.cgi?id=61113

Well, for me it was solved by updating the packages one by one, setting the dependencies option to "None"

Updating the packages one by one works for me too

For me, the dependencies option to "none" did not help but this gave me an idea.
I faced this problem only while updating Xamarin NuGet packages in the Android project and I noticed that all the other projects properly received the packages, so I was able to work-around this by reinstalling the Xamarin packages for the Android project using the "Force uninstall" option in the NuGet window, since I was (99% :-) ) that no dependencies would be affected.

Anything new on this?

I'm even unable to start new Xamarin.Forms Android projects, so this is pretty important to fix soon.

The newest visual studio update (15.5.6) seems to fix this for me. I must note that I am also running as Administrator now.

Can still be replicated on a Xamarin.Android project in Visual Studio 15.5.6. I was installing Firebase Analytics nuget package.

Same issue here, with Xamarin.Forms from 2.3.3.175 to 2.5.0.122203, VS 2017 15.5.2

In my computer with vs 2017 15.5.6, Msbuild.exe is in execution and lock xamarin.forms package file.
Update work when i kill Msbuild.exe instance

Seems that the problems is the Xamarin.Android.SupportV4 Package.

i have updated Xamarin.Forms with Ignore dependencies option, then i was updating the packages one by one until trying to update the Xamarin.Android.Support.Animated.Vector.Drawable Package. I tried to uninstall the package to install it again, but then, the same error again: the collection is read only

Then another error came out, that there was missing packages and that i have to restore the packages, but i have restored the packages like 10 times and the package restoration said that there was nothing to restore, but this error have additional info, it said that the missing package was Xamarin.Android.SupportV4, then i looked for it, updated it and after update this package i was able to update the Xamarin.Android.SupportV4 Package.

maybe, if you update this package before update the xamarin forms one then you will be able to update the xamarin forms and its dependencies in the normal way

Running as Administrator solved this for me! Thanks to nicknijenhuis.

Im still seeing this in VS Pro 15.5.7

Previously a random sequence of dark arts (removing nuget cache, bin, obj and packages folders, running as administrator) has worked for me, but this no longer seems to be enough - Im still seeing the issue when updating Xamarin.Forms

I am able to update packages one-by-one, ignoring dependencies as @Bloodday suggested, but the problem still occurs: "This collection is read-only". And yet, right after the problem occurring for each single package update, I can click "Update" again for the same package, and then it succeeds. It's tedious, but I got my packages updated, one by one, each failing, and each then succeeding on second try.

One interesting thing about this is the "Install failed. Rolling back..." part of the nuget package update output occurs in a context where nothing above the message appears to have failed. The "This collection is read-only" message appears later, after "Executing nuget actions took X.XX sec", which I would expect to be the last thing output by nuget. I would have instead expected the error to precede the message about rollback. Are error messages perhaps buffered elsewhere and sent to the output window out-of-context? e.g. stderr vs stdout.

(p.s. I'm on Visual Studio 15.5.7, NuGet Package Manager 4.5.0.)

@cwrea Thanks. That did the trick for me! :-)

For installing Xamarin.Firebase.Messaging (60.1142.0), I had to install the dependencies first:

  • Xamarin.GooglePlayServices.Basement (= 60.1142.0)
  • Xamarin.Firebase.Common (= 60.1142.0)
  • Xamarin.Firebase.Iid (= 60.1142.0)

After that, the first try of clicking "Install" for the Xamarin.Firebase.Messaging package failed with "This collection is read-only". A second try succeeded.

(Visual Studio 15.5.6)

The only thing that worked for me was to create a new project and add each dependency with NuGet, noticing what went wrong each time, and solving it before moving on. I then had a working csproject with no files, so I added them from the old project, until it worked.

Was stuck for a full day, so this was the only option for me.

  • I got the same issue with VS 15.6.0, NuGet 6.4.0, and I am now unable to build my Xamarin solution.

    Sorry but my solution include 118 NuGet packages, and it is a little too much to install them one by one. Is there really no other way to solve this ?

Edit : If this could help Xamarin users...

Although the new packages still do not install, I finally could rebuild my solution after some manipulations :

  1. I closed VS.
  2. Then, in my .Android.csproj, I replaced the "27.0.2" by "26.1.0.1" in the
    <Import Project="..\..\packages\Xamarin.Android.Support. ...
    and deleted the content of <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">, full of <Error>'s.

I'm seeing similar issues installing recent Xamarin Android support updates. I have 26.1.0.1 and 27.0.2 just won't install.

Installing Xamarin.Android.Support.Design 27.0.2.
  OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.mediarouter/27.0.2/xamarin.android.support.v7.mediarouter.27.0.2.nupkg 8489ms
Installing Xamarin.Android.Support.v7.MediaRouter 27.0.2.
Install failed. Rolling back...
Package 'Xamarin.Android.Support.Annotations 27.0.2' does not exist in project 'Backroads.Android'
Package 'Xamarin.Android.Support.Annotations 26.1.0.1' already exists in folder 'O:\Build\Home\Backroads\Source\packages'
Added package 'Xamarin.Android.Support.Annotations 26.1.0.1' to 'packages.config'
...
This collection is read-only.

I've tried the following workaround with no success:

  • Clean project, delete bin/obj
  • Delete nuget cache
  • Re-run VS as administrator

Same here.

[edit] Solved by running as admin, disabling a local nuget source, ignore dependencies and install them one by (often twice in a row), clearing the obj folder between installs.
[edit] With some packages I would see a license agreement the 2nd time i clicked install (and then it would install.

Ignoring dependencies and click install twice for each package seemed to be the winner.

After spending four hours trying to make this work, I finally managed to get the nuget packages to update. The trick was to run VS2017 as Administrator by right-clicking the shortcut and selecting "Run as Administrator". I also had to update the packages one by one and select "Ignore Dependencies".

@wvdvegt: thanks for that. I was able to install the recalcitrant 18 packages as you mention: installing them one by one from the package manager with -ignoredependencies and running each command twice.

MSFT, you may want to make this a bit easier for us.

Interestingly, opening the same solution in VS for Mac and updating all the nuget packages works just fine (and a LOT faster)

The same error happens with the recently released Xamarin.Android 27.0.2. When is this going to be fixed?

@ddobrev Same problem.

@ddobrev the same for me in vs2017 15.6.1 and this is not the first time I've had this problem :S

Same issue here with the latest Visual Studio 2017 update (15.6.3). It's really frustrating that such an expensive software has such a critical bug for so long. It's impossible to update NuGet packages through the UI at the moment you have to modify the *.csproj and *.packages file manually (at least for Xamarin.Forms (Android) projects.

This needs to be fixed ASAP. Not a word from Microsoft either, which is worrying.

Same problem here.

This is under investigation, and the thread will be updated as soon as we've more information.

For now, please follow some of the workarounds already mentioned in this thread.

Same problem here

reopening this bug since earlier solution wasn't the ideal fix and introduce some other issue.

this is sooooooooooooooooooooo annoying. I am wasting whole day to update support libraries and at the end i end up reverting all to previous version. somebody said that it works on MAC. because it is not VS2017 on mac. It is Xamarin Stuidio copy rebranded as VS2017 Mac and it has a better nuget update mechanism. Please do some afford on this instead of playing around button style and reverting them back

I lost 2 days working on this issue!

Finally I successfully installed the latest Xamarin.Forms v2.5.0.280555
Open Package Manager Console window.
And run the below commands (the order is important) .

install-package Xamarin.Android.Support.Annotations -version 25.4.0.2 
install-package Xamarin.Android.Support.Compat -version 25.4.0.2 
install-package Xamarin.Android.Support.Core.Utils -version 25.4.0.2 
install-package Xamarin.Android.Support.Core.UI -version 25.4.0.2
install-package Xamarin.Android.Support.Media.Compat -version 25.4.0.2
install-package Xamarin.Android.Support.Fragment -version 25.4.0.2
install-package Xamarin.Android.Support.Transition -version 25.4.0.2
install-package Xamarin.Android.Support.v7.CardView -version 25.4.0.2
install-package Xamarin.Android.Support.v7.Palette -version 25.4.0.2
install-package Xamarin.Android.Support.v4 -version 25.4.0.2
install-package Xamarin.Android.Support.v7.RecyclerView -version 25.4.0.2
install-package Xamarin.Android.Support.Vector.Drawable -version 25.4.0.2
install-package Xamarin.Android.Support.v7.AppCompat  -version 25.4.0.2
install-package Xamarin.Android.Support.Design -version 25.4.0.2
install-package Xamarin.Android.Support.v7.MediaRouter -version 25.4.0.2
install-package Xamarin.Forms -version 2.5.0.280555

(I am using Visual Studio Enterprise v15.6.4. NuGet Package Manager v4.6.0)

PS: Sometimes some packages didn't install. But when I insist on and run the same command again they somehow got installed (weird!)

Note: I guess there's a problem when resolving dependencies for Xamarin.Forms.

Lastly, to the Xamarin team: People cannot know which Xamarin.Android.Support package is compatible with Xamarin.Forms. An average Xamarin developer tries to update all the packages to the latest. And it results as a show stopper! Please find a way.

same problem here. partially solved by updating one package (Xamarin.Android.Support.Core.UI) to 27.0.2 which is something i usually never do for all Xamarin.Android.* packages.
it updated all related packages but when i tried updating Com.Airbnb.Xamarin.Forms.Lottie to the latest version which requires all xamarin.Android.* to be >= 26.0.1 , it fails again ....
this is a mess.

there is a common error that appears often when this update problem started happening : "Collection is Read Only" .

I Had the problem did 3-4 hours of things listed in the post and got my project working again. Now its back and I have spent hours trying to get it working again. We NEED an answer to this from Xamarin and need it fast. Firebase messaging and Xamarin Maps seems to be mutually exclusive. Please help!!!

In the nevering story of nuget updates I have to bring my experience.

Today the match was to update xamarin forms from 2.3.something to 2.5 in a complex project.

Obviously, nothing worked on the first step. Trying to solve the problem, after have changed the target framework to the latest available, I discovered this thread.

My problem started with Visual Studio that told me:

Severity    Code    Description Project File    Line    Suppression State
Error       Unable to find a version of 'Xamarin.Android.Support.Design' that is compatible with 'Xamarin.Forms 2.5.0.280555 constraint: Xamarin.Android.Support.Design (= 23.3.0)'.            0   

Access to the path 'Xamarin.Android.Support.Tasks.VectorDrawable.dll' is denied.
Removed package 'Xamarin.Android.Support.Vector.Drawable.25.4.0.2 : Xamarin.Android.Support.Compat [25.4.0.2, 25.4.0.2]' from folder ' solutions\packages'
Executing nuget actions took 54,25 sec
install-package : This collection is read-only.
At line:1 char:1
+ install-package Xamarin.Android.Support.v7.MediaRouter -version 25.4. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Following the precious instructions of @ebicoglu I tried to update the packages via nuget console and it works for almost every package, except for Xamarin.Android.Support.Animated.Vector.Drawable.

I discovered that in my csproj there already was some rows related to the previous mono version, these:

<Error Condition="!Exists('..\..\solutions\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\solutions\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets'))" />

so I removed them from my file (Droid.csproj).
Then, I still was not able to install the drawable target, because I also have to remove (manually) these lines:

<Import Project="..\..\solutions\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\..\solutions\packages\Xamarin.Android.Support.Animated.Vector.Drawable.25.4.0.2\build\MonoAndroid70\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />

after this, I was able to install Xamarin.Android.Support.Animated.Vector.Drawable. Then, a new error is appeared, related to customtabs that I was not installed but that was probably a dependency of Xam.Auth package:

  Severity  Code    Description Project File    Line    Suppression State
Error       Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Xamarin.Android.Support.CustomTabs, Version=1.0.0.0, Culture=neutral, PublicKeyToken='. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'Xamarin.Android.Support.CustomTabs.dll'
   at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(DirectoryAssemblyResolver resolver, ICollection`1 assemblies, AssemblyDefinition assembly, Boolean topLevel)
   at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)   FakeTitle.Droid 

Nuget UI was unable to install. Install via package manager give me this new error:

Install failed. Rolling back...
Package 'Xamarin.Android.Support.CustomTabs.27.0.2 : Xamarin.Android.Support.Compat [27.0.2, 27.0.2]' does not exist in project 'FakeTitle.Droid'
Package 'Xamarin.Android.Support.CustomTabs.27.0.2 : Xamarin.Android.Support.Compat [27.0.2, 27.0.2]' does not exist in folder ' solutions\packages'
Executing nuget actions took 10,04 sec
install-package : Access to the path ' solutions\packages\Xamarin.Android.Support.CustomTabs.27.0.2\lib/MonoAndroid81/Xamarin.Android.Support.CustomTabs.dll' is denied.
At line:1 char:1
+ install-package Xamarin.Android.Support.CustomTabs
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:10.4734303   

so, go back and remove these lines from csproj:

    <Error Condition="!Exists('..\..\solutions\packages\Xamarin.Android.Support.CustomTabs.27.0.2\build\MonoAndroid81\Xamarin.Android.Support.CustomTabs.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\solutions\packages\Xamarin.Android.Support.CustomTabs.27.0.2\build\MonoAndroid81\Xamarin.Android.Support.CustomTabs.targets'))" />

      <Import Project="..\..\solutions\packages\Xamarin.Android.Support.CustomTabs.27.0.2\build\MonoAndroid81\Xamarin.Android.Support.CustomTabs.targets" Condition="Exists('..\..\solutions\packages\Xamarin.Android.Support.CustomTabs.27.0.2\build\MonoAndroid81\Xamarin.Android.Support.CustomTabs.targets')" />

then reinstall via package manager and finally I was able to close this task.

from the package manager console:
Update-Package [packageName] -ignoreDependencies
for each package one by one.

Same problem over here. After removing packages, bin and obj folders, cleanup nuget cache, cleaning the solution and restarting vs as admin, I finally managed to update the packages simply by changing the forms package to 2.5.x

After detailed analysis, we've figured out that this needs to be fixed from Xamarin team and there is already an issue# https://bugzilla.xamarin.com/show_bug.cgi?id=61113 logged on to them. So please vote and comment and track Xamarin issue to get future updates.

The last bugzilla bug comment says:

This bug is also filed in the NuGet repository on GitHub, at https://github.com/NuGet/Home/issues/6468, and it's fixed there.

So we just need to wait to be included in VS ...

What fix is this referring to? Seems like a circular reference. Both issues refer to each other but I don't see a fix.

That last comment is 7 days ago, that time we thought we might be able to handle it from our end. But that wasn't the case so we updated this thread and continued our investigation. Now, we've identified the right root cause, and the right fix needs to come from Xamarin which has been communicated to them.

So what does this mean:

So we just need to wait to be included in VS ...

That sounds like there is a fix and it is just waiting to be included in VS. What fix are we talking about? It seems that both Microsoft and Xamarin are saying that it's something for the other "side" to fix.

suggestion from @InquisitorJax works. you can also use the ui and "ignore dependencies" option instead of lower. generally first attempt returns "collection is read only" error but 2nd one works with this option. At the end, android proj file becomes a mess with old imports, error lines, you have to remove them manually. It seems that xamarin has a problem to manage proj file regarding nuget references and they dont seem to do any afford about it

image

So what does this mean:

So we just need to wait to be included in VS ...

@activa, I created the bug at xamarin, and later the a bug report was also created, and reported as fixed in this issue.

So I updated the bug at xamarin, but the fix was later withdrawn by the NuGet team ...

Closing this issue. Making sure the feedback issue gets transferred to Xamarin Android teams.
Also sending email to @kzu and others.

So why are you closing this issue @rrelyea ? It's not fixed and there's no reference to another bug. Both sides are pointing to the other side.

So who's going to take responsibility for this blocker issue?
Xamarin is ignoring it. Microsoft is ignoring it. Are you going to continue pointing fingers at each other? Isn't Xamarin part of Microsoft now?

@rrelyea @jainaashish

I have been assured that this fix is already in the current 15.7 previews, and will make it to stable.

Please do let me know if you can verify it works for you.

Thanks!

Looks like it works in 15.7 preview 2, first time I was able to update Xamarin packages since 15.4.5.

Thanks for confirming. Please do make sure to update (or manually install to get latest) version of https://www.nuget.org/packages/Xamarin.Build.Download since that will bring substantial performance benefits for incremental builds in Xamarin.Android projects.

@kzu, And then I got the "This collection is read-only" again, but this time when I was updating Xamarin.Firebase.Messaging. Still using 15.7 preview 2.0.

Attempting to gather dependency information for multiple packages with respect to project 'Applications\LexTalk.Android', targeting 'MonoAndroid,Version=v8.0'
Gathering dependency information took 9,76 sec
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'Xamarin.Firebase.Common 60.1142.1' from 'nuget.org'.
Retrieving package 'Xamarin.Firebase.Iid 60.1142.1' from 'nuget.org'.
Retrieving package 'Xamarin.Firebase.Messaging 60.1142.1' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Base 60.1142.1' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Basement 60.1142.1' from 'nuget.org'.
Retrieving package 'Xamarin.GooglePlayServices.Tasks 60.1142.1' from 'nuget.org'.
Removed package 'Xamarin.GooglePlayServices.Base 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.GooglePlayServices.Base 60.1142.0' from LexTalk.Android
Removed package 'Xamarin.Firebase.Messaging 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.Firebase.Messaging 60.1142.0' from LexTalk.Android
Removed package 'Xamarin.Firebase.Iid 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.Firebase.Iid 60.1142.0' from LexTalk.Android
Removed package 'Xamarin.Firebase.Common 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.Firebase.Common 60.1142.0' from LexTalk.Android
Removed package 'Xamarin.GooglePlayServices.Tasks 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.GooglePlayServices.Tasks 60.1142.0' from LexTalk.Android
Removed package 'Xamarin.GooglePlayServices.Basement 60.1142.0' from 'packages.config'
Successfully uninstalled 'Xamarin.GooglePlayServices.Basement 60.1142.0' from LexTalk.Android
Adding package 'Xamarin.GooglePlayServices.Basement.60.1142.1' to folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.GooglePlayServices.Basement.60.1142.1' to folder 'U:\Repos\LexTalk\packages'
Install failed. Rolling back...
Package 'Xamarin.GooglePlayServices.Basement 60.1142.1' does not exist in project 'LexTalk.Android'
Package 'Xamarin.GooglePlayServices.Basement 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.GooglePlayServices.Basement 60.1142.0' to 'packages.config'
Package 'Xamarin.GooglePlayServices.Tasks 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Package 'Xamarin.Firebase.Common 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.Firebase.Common 60.1142.0' to 'packages.config'
Package 'Xamarin.Firebase.Iid 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Package 'Xamarin.Firebase.Messaging 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.Firebase.Messaging 60.1142.0' to 'packages.config'
Package 'Xamarin.GooglePlayServices.Base 60.1142.0' already exists in folder 'U:\Repos\LexTalk\packages'
Added package 'Xamarin.GooglePlayServices.Base 60.1142.0' to 'packages.config'
Removing package 'Xamarin.GooglePlayServices.Basement 60.1142.1' from folder 'U:\Repos\LexTalk\packages'
Removed package 'Xamarin.GooglePlayServices.Basement 60.1142.1' from folder 'U:\Repos\LexTalk\packages'
Executing nuget actions took 1,1 min
This collection is read-only.
Time Elapsed: 00:01:16.2593459
========== Finished ==========

We'll need full logs, since that code isn't even in our extension anymore. It may be some other code path.

How do I create full logs?

Still getting this stupid error if I want to update within the latest stable of VS2017... so annoying...

As mentioned above @Sebastian1989101 , the fix is in VS2017 preview, not stable. Please give it a try with the latest preview and if you can, confirm whether it fixes it for you?

Thanks

@kzu
any idea when we are getting the vs2017 release that include this fix?This has been a blocker for a while.
Workaround in the meantime?

As I mentioned, it is already released in VS2017 Preview (as of this writing, that's Preview 4). Whenever that hits stable, it will be available in VS2017 15.7.

I've just installed VS2017 V15.7 Preview 5.0 and it STILL has this issue. This is not fixed @kzu.

I'm happy to provide better logs if you tell me how to get them, but at the minute all I have for you is:

Attempting to gather dependency information for package 'Xamarin.Forms.2.5.1.444934' with respect to project 'UI\Mobile4Projects.Droid.CN', targeting 'MonoAndroid,Version=v8.1'
Gathering dependency information took 582.79 ms
Attempting to resolve dependencies for package 'Xamarin.Forms.2.5.1.444934' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Xamarin.Forms.2.5.1.444934'
Resolved actions to install package 'Xamarin.Forms.2.5.1.444934'
Found package 'Xamarin.Android.Support.Animated.Vector.Drawable 25.4.0.2' in 'C:\Workspace\M4Projects\packages'.
* SNIP*
Executing nuget actions took 1.52 min
This collection is read-only.
Time Elapsed: 00:01:32.0527411
========== Finished ==========

This is not fixed in 15.7 (final released)

"This collection is read-only" when trying to update the Xamarin Forms nuget package.

Jup I can confirm that this is still not fixed in 15.7.0. It's really sad that they don't get this working...

Still seeing this in VS 15.7.1 while updating multiple projects to Xamarin Forms 3.0 (not that the package should matter) with ignore dependencies switched on.

Latest VS 2017, new project, trying to install Xamarin.Forms;

```Package Manager Console Host Version 4.7.0.5148

Type 'get-help NuGet' to see all available NuGet commands.

PM> install-package Xamarin.Forms
Restoring NuGet package Unity.4.0.1.
Restoring NuGet package Xamarin.Forms.2.4.0.91020.
Restoring NuGet package Xamarin.Android.Support.Annotations.25.4.0.2.
Adding package 'Unity.4.0.1' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Adding package 'Xamarin.Android.Support.Annotations.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Adding package 'Xamarin.Forms.2.4.0.91020' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Added package 'Unity.4.0.1' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Added package 'Xamarin.Android.Support.Annotations.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Added package 'Xamarin.Forms.2.4.0.91020' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'

Attempting to gather dependency information for package 'Xamarin.Forms.3.0.0.482510' with respect to project 'Ri.Iceland.Android', targeting 'MonoAndroid,Version=v8.0'
Gathering dependency information took 2.97 sec
Attempting to resolve dependencies for package 'Xamarin.Forms.3.0.0.482510' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Xamarin.Forms.3.0.0.482510'
Resolved actions to install package 'Xamarin.Forms.3.0.0.482510'
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.fragment/25.4.0.2/xamarin.android.support.fragment.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.cardview/25.4.0.2/xamarin.android.support.v7.cardview.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.forms/3.0.0.482510/xamarin.forms.3.0.0.482510.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.media.compat/25.4.0.2/xamarin.android.support.media.compat.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v4/25.4.0.2/xamarin.android.support.v4.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.transition/25.4.0.2/xamarin.android.support.transition.25.4.0.2.nupkg
Retrieving package 'Xamarin.Android.Support.Animated.Vector.Drawable 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Compat 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Core.UI 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Core.Utils 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Design 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Fragment 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Media.Compat 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Transition 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v4 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v7.AppCompat 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v7.CardView 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v7.MediaRouter 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v7.Palette 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.v7.RecyclerView 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Android.Support.Vector.Drawable 25.4.0.2' from 'nuget.org'.
Retrieving package 'Xamarin.Forms 3.0.0.482510' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.mediarouter/25.4.0.2/xamarin.android.support.v7.mediarouter.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.vector.drawable/25.4.0.2/xamarin.android.support.vector.drawable.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.animated.vector.drawable/25.4.0.2/xamarin.android.support.animated.vector.drawable.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.palette/25.4.0.2/xamarin.android.support.v7.palette.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.recyclerview/25.4.0.2/xamarin.android.support.v7.recyclerview.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.appcompat/25.4.0.2/xamarin.android.support.v7.appcompat.25.4.0.2.nupkg
GET https://api.nuget.org/v3-flatcontainer/xamarin.android.support.design/25.4.0.2/xamarin.android.support.design.25.4.0.2.nupkg
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.cardview/25.4.0.2/xamarin.android.support.v7.cardview.25.4.0.2.nupkg 597ms
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.fragment/25.4.0.2/xamarin.android.support.fragment.25.4.0.2.nupkg 597ms
Installing Xamarin.Android.Support.Fragment 25.4.0.2.
Installing Xamarin.Android.Support.v7.CardView 25.4.0.2.
Adding package 'Xamarin.Android.Support.Compat.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Added package 'Xamarin.Android.Support.Compat.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.transition/25.4.0.2/xamarin.android.support.transition.25.4.0.2.nupkg 1336ms
Installing Xamarin.Android.Support.Transition 25.4.0.2.
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v4/25.4.0.2/xamarin.android.support.v4.25.4.0.2.nupkg 2111ms
Installing Xamarin.Android.Support.v4 25.4.0.2.
Added package 'Xamarin.Android.Support.Compat.25.4.0.2' to 'packages.config'
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.vector.drawable/25.4.0.2/xamarin.android.support.vector.drawable.25.4.0.2.nupkg 2699ms
Installing Xamarin.Android.Support.Vector.Drawable 25.4.0.2.
Successfully installed 'Xamarin.Android.Support.Compat 25.4.0.2' to Ri.Iceland.Android
Adding package 'Xamarin.Android.Support.Core.UI.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Added package 'Xamarin.Android.Support.Core.UI.25.4.0.2' to folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.palette/25.4.0.2/xamarin.android.support.v7.palette.25.4.0.2.nupkg 3357ms
Installing Xamarin.Android.Support.v7.Palette 25.4.0.2.
OK https://api.nuget.org/v3-flatcontainer/xamarin.forms/3.0.0.482510/xamarin.forms.3.0.0.482510.nupkg 3370ms
Installing Xamarin.Forms 3.0.0.482510.
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.appcompat/25.4.0.2/xamarin.android.support.v7.appcompat.25.4.0.2.nupkg 4096ms
Installing Xamarin.Android.Support.v7.AppCompat 25.4.0.2.
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.design/25.4.0.2/xamarin.android.support.design.25.4.0.2.nupkg 5405ms
Installing Xamarin.Android.Support.Design 25.4.0.2.
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.media.compat/25.4.0.2/xamarin.android.support.media.compat.25.4.0.2.nupkg 6014ms
Installing Xamarin.Android.Support.Media.Compat 25.4.0.2.
OK https://api.nuget.org/v3-flatcontainer/xamarin.android.support.v7.recyclerview/25.4.0.2/xamarin.android.support.v7.recyclerview.25.4.0.2.nupkg 6199ms
Installing Xamarin.Android.Support.v7.RecyclerView 25.4.0.2.
Install failed. Rolling back...
Package 'Xamarin.Android.Support.Core.UI.25.4.0.2 : Xamarin.Android.Support.Compat [25.4.0.2, 25.4.0.2]' does not exist in project 'Ri.Iceland.Android'
Removed package 'Xamarin.Android.Support.Compat.25.4.0.2 : Xamarin.Android.Support.Annotations [25.4.0.2, 25.4.0.2]' from 'packages.config'
Removing package 'Xamarin.Android.Support.Core.UI.25.4.0.2 : Xamarin.Android.Support.Compat [25.4.0.2, 25.4.0.2]' from folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Removed package 'Xamarin.Android.Support.Core.UI.25.4.0.2 : Xamarin.Android.Support.Compat [25.4.0.2, 25.4.0.2]' from folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Removing package 'Xamarin.Android.Support.Compat.25.4.0.2 : Xamarin.Android.Support.Annotations [25.4.0.2, 25.4.0.2]' from folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Removed package 'Xamarin.Android.Support.Compat.25.4.0.2 : Xamarin.Android.Support.Annotations [25.4.0.2, 25.4.0.2]' from folder 'C:\CodeBase\Mobile Development\Retail HHT Mobile Apps\packages'
Executing nuget actions took 8.62 sec
install-package : This collection is read-only.
At line:1 char:1

  • install-package Xamarin.Forms
  • ~~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [Install-Package], Exception

    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:16.3849315
PM> ```

It's in 15.7.2 which just shipped.

Thanks

@kzu Updated VS and both projects now updated via nuget with no issues or rollback. Thanks

Thanks a lot @lywyn for validating!

Was this page helpful?
0 / 5 - 0 ratings