Docs: An item with the same key has already been added. Key: Microsoft.NETCore.App

Created on 29 Oct 2016  路  2Comments  路  Source: dotnet/docs

File project.json of the test project contains 2 items with the same key on Lines 6 and 19:

Visual Studio 2015 shows the following error:
image

Here is the project.json file structure reference: https://docs.microsoft.com/en-us/dotnet/articles/core/tools/project-json#frameworks

I think there should be only one dependency: either package-level or framework-specific.

doc-bug

All 2 comments

I ran into the same issue while upgrading a netcoreapp1.0 to netcoreapp1.1 from Nuget as well as manually changing the frameworks section to
"frameworks": { "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.1.0" } }, "imports": [ "dotnet5.6", "portable-net45+win8" ] } },

I was left with a top level dependency on "Microsoft.NETCore.App" which spawned the error above. Just deleting it and rebuild solved the problem. As in your example above, I deleted lines 6 through 9 and it worked.

@ovidiaconescu agree with you. I did the same.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ygoe picture ygoe  路  3Comments

svick picture svick  路  3Comments

mekomlusa picture mekomlusa  路  3Comments

garfbradaz picture garfbradaz  路  3Comments

ite-klass picture ite-klass  路  3Comments