Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

KeyNotFoundException when running dnu restore with Contentful.NET package #2970

Closed
rytmis opened this issue Oct 13, 2015 · 2 comments
Closed
Assignees
Milestone

Comments

@rytmis
Copy link

rytmis commented Oct 13, 2015

Running dnu restore (1.0.0-beta7, clr, win-x86) on the following project.json file:

{
  "version": "1.0.0-*",
  "description": "RestoreRepro Console Application",
  "authors": ["your name"],
  "tags": [""],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {
        "Contentful.NET": "0.0.5-Alpha"  
  },

  "commands": {
    "ConsoleApplication": "ConsoleApplication"
  },

  "frameworks": {
    "dnx451": {}
  }
}

results in a KeyNotFoundException:

C:\temp\RestoreRepro
λ dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta7-15532

  CACHE https://api.nuget.org/v3/index.json
Restoring packages for C:\temp\RestoreRepro\project.json
Writing lock file C:\temp\RestoreRepro\project.lock.json
----------
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.Dnx.Tooling.RestoreCommand.WriteLockFile(LockFile previousLockFile, String projectLockFilePath, Project project, List`1 graphItems, PackageRepository repository, IProjectResolver projectResolver, IEnumerable`1 contexts)
   at Microsoft.Dnx.Tooling.RestoreCommand.<RestoreForProject>d__61.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Dnx.Tooling.RestoreCommand.<>c__DisplayClass60_0.<<Execute>b__2>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Dnx.Tooling.RestoreCommand.<Execute>d__60.MoveNext()
----------
Restore failed
The given key was not present in the dictionary.

NuGet Config files used:
    C:\Users\lauri\AppData\Roaming\NuGet\NuGet.Config

Feeds used:
    https://api.nuget.org/v3-flatcontainer/
@davidfowl
Copy link
Member

Looks like a casing bug with versions.

@rytmis
Copy link
Author

rytmis commented Oct 13, 2015

Renaming the package directory from 0.0.5-alpha to 0.0.5-Alpha got me past the error.

@davidfowl davidfowl self-assigned this Oct 13, 2015
@davidfowl davidfowl added this to the 1.0.0-rc1 milestone Oct 13, 2015
davidfowl added a commit that referenced this issue Oct 13, 2015
- Always update the nuspec with the resolved version and id on
install.

#2970
davidfowl added a commit that referenced this issue Oct 14, 2015
- Always update the nuspec with the resolved version and id on
install.

#2970
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants