Reputation: 10602
When I try to update Dapper (or any other NuGet package), Visual Studio displays:
An error occurred while writing file 'T:\ProjectPath\packages.config': Packages node does not exists in packages.config at T:\ProjectPath\packages.config.
The exact contents of said file are:
<?xml version="1.0" encoding="utf-8"?>
<packages xmlns="urn:packages">
<package id="Antlr" version="3.5.0.2" targetFramework="net45" xmlns="" />
<package id="Dapper" version="1.42" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" xmlns="" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net451" xmlns="" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net451" xmlns="" />
<package id="Moment.js" version="2.10.2" targetFramework="net451" xmlns="" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net451" xmlns="" />
<package id="NLog" version="4.0.1" targetFramework="net451" xmlns="" />
<package id="NLog.Config" version="4.0.1" targetFramework="net451" xmlns="" />
<package id="NLog.Schema" version="4.0.1" targetFramework="net451" xmlns="" />
<package id="Oracle.ManagedDataAccess" version="12.1.021" targetFramework="net451" xmlns="" />
<package id="WebGrease" version="1.6.0" targetFramework="net45" xmlns="" />
</packages>
A package node certainly seems to exist.
I have tried update-package dapper
, update-package dapper -Reinstall
, and uninstall-package dapper -Force
. All yield:
PM> Update-Package dapper
Attempting to gather dependency information for multiple packages with respect to project 'ImplantRecipeDatabase', targeting '.NETFramework,Version=v4.5.1'
Attempting to resolve dependencies for multiple packages.
Resolving actions install multiple packages
Install failed. Rolling back...
Package 'Dapper 1.42' already exists in project 'ImplantRecipeDatabase'
Update-Package : An error occurred while writing file 'T:\Dropbox\WorkProjects\DataManager\ImplantRecipeDatabase\packages.config': Packages node does not exists in packages.config at T:\Dropbox\WorkProjects\DataManager\ImplantRecipeDatabase\packages.config.
At line:1 char:15
+ Update-Package <<<< dapper
+ CategoryInfo : NotSpecified: (:) [Update-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.UpdatePackageCommand
Note that the most recent version of Dapper found by NuGet as of this writing is 1.50.1
The errors aren't helpful, so I am not sure where to go from here. I have tried installing the most recent update for VS2015 Update 3 (kb3165756) and have the most recent version of NuGet (3.4.4.1321). What should I try next?
Upvotes: 2
Views: 1448
Reputation: 47987
Your packages.config file does not look correct. It has xmlns attributes where a normal packages.config would not have any. Having the root packages element in a different namespace may well be the cause of the problem. I would expect the packages.config file to look more like:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Antlr" version="3.5.0.2" targetFramework="net45" />
Upvotes: 3