Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can't add any nuget package in my asp.net MVC Applications

An item with the same key has already been added error show. What is the problem i don't know.
Full Error

PM> Install-Package EntityFramework
Attempting to gather dependencies information for package 'EntityFramework.6.1.3' with respect to project targeting '.NETFramework, Version=v4.5'
Attempting to resolve dependencies for package 'EntityFramework.6.1.3' with DependencyBehavior 'Lowest'
Resolving actions to install package 'EntityFramework.6.1.3'
Resolved actions to install package 'EntityFramework.6.1.3'
Adding package 'EntityFramework 6.1.3' to folder 'E:\Applications\ERP\packages'
Added package 'EntityFramework 6.1.3' to folder 'E:\Applications\ERP\packages'
Added package 'EntityFramework 6.1.3' to 'packages.config'
Executing script file 'E:\Applications\ERP\packages\EntityFramework.6.1.3\tools\init.ps1'
Executing script file 'E:\Applications\ERP\packages\EntityFramework.6.1.3\tools\install.ps1'

Type 'get-help EntityFramework' to see all available Entity Framework commands.
Successfully installed 'EntityFramework 6.1.3' to ERP.Data.
Install failed. Rolling back...
Removed package 'EntityFramework 6.1.3' from 'packages.config'
Removing package 'EntityFramework 6.1.3' from folder 'E:\Applications\ERP\packages'
Access to the path 'E:\Applications\ERP\packages\EntityFramework.6.1.3\tools\EntityFramework.PowerShell.Utility.dll' is denied.
Access to the path 'EntityFramework.PowerShell.Utility.dll' is denied.
Removed package 'EntityFramework 6.1.3' from folder 'E:\Applications\ERP\packages'
Install-Package : An item with the same key has already been added.
At line:1 char:1
+ Install-Package EntityFramework
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Posted
Updated 28-Jun-15 22:43pm
v4
Comments
Sreekanth Mothukuru 29-Jun-15 3:00am    
Do you have problem installing only Entity Framework or all other packages from NuGet ?
[no name] 29-Jun-15 5:28am    
All other packages also.
xszaboj 29-Jun-15 4:17am    
Maybe problem is this:
Access to the path 'EntityFramework.PowerShell.Utility.dll' is denied.

have you tried to run studio as admin? or check if this file is not set as read only?
[no name] 29-Jun-15 5:32am    
I have run visual studio as administrator mode and also permission my applications files physical path but same result.
Sreekanth Mothukuru 29-Jun-15 6:09am    
Delete all items from the package.config file and try to build the solution once.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900