Search code examples
visual-studiovisual-studio-2015nugetumbracoumbraco-ucommerce

Nuget Install always fails after successfull install


I'm working on a project using Umbraco 7.3.1, Ucommerce 6.8.3, NuGet 3.2.6 and running Visual Studio 2015 on Windows 10 pro (x64)

For some reason I am unable to install any Nuget package in the project. This problem seems to appear after I install ucommerce in the project.

Here is an example where I attempt to install jQuery. Note that this issue is not related to jQuery, I get this error with all packages.

PM> Install-Package jQuery
Attempting to gather dependencies information for package 'jQuery.2.1.4' with respect to project '[Project-Name]', targeting '.NETFramework,Version=v4.6'
Attempting to resolve dependencies for package 'jQuery.2.1.4' with DependencyBehavior 'Lowest'
Resolving actions to install package 'jQuery.2.1.4'
Resolved actions to install package 'jQuery.2.1.4'
Adding package 'jQuery.2.1.4' to folder 'C:\Projects\uCommerce\[Project-Name]\packages'
Added package 'jQuery.2.1.4' to folder 'C:\Projects\uCommerce\[Project-Name]\packages'
Added package 'jQuery.2.1.4' to 'packages.config'
Executing script file     'C:\Projects\uCommerce\[Project-Name]\packages\jQuery.2.1.4\tools\install.ps1'
Successfully installed 'jQuery 2.1.4' to [Project-Name]
Install failed. Rolling back...
Removed package 'jQuery 2.1.4' from 'packages.config'
Executing script file 'C:\Projects\uCommerce\[Project-Name]\packages\jQuery.2.1.4\Tools\uninstall.ps1'
Removing package 'jQuery 2.1.4' from folder 'C:\Projects\uCommerce\[Project-Name]\packages'
Removed package 'jQuery 2.1.4' from folder 'C:\Projects\uCommerce\[Project-Name]\packages'
Install-Package : Object reference not set to an instance of an object.
At line:1 char:1
+ Install-Package jQuery
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

The odd thing here is that if first sais Successfully installed 'jQuery 2.1.4' to [Project-Name], immediately followed by Install failed. Rolling back...

I never seem to get any usefull stack trace.

A colleague of mine who initially set up this project also has the same problem.

We have tried a lot of things, including a clean reinstall of windows and setting up the entire project from scratch again with new solution files and a new database, but the problem always comes back.

EDIT: Here is a list of all the currently installed NuGet-packages

Id Versions
-- --------
Antlr {3.4.1.9004}
AutoMapper {3.0.0}
ClientDependency {1.8.4}
ClientDependency-Mvc5 {1.8.0.0}
Examine {0.1.68.0}
HtmlAgilityPack {1.4.9}
idseefeld.de.UmbracoAzure {1.0.0.0}
ImageProcessor {2.3.0.0}
ImageProcessor.Web {4.4.0.0}
Lecoati.LeBlender {1.0.8.2}
Lucene.Net {2.9.4.1}
Microsoft.AspNet.Identity.Core {2.2.1}
Microsoft.AspNet.Identity.Owin {2.2.1}
Microsoft.AspNet.Mvc {5.2.3}
Microsoft.AspNet.Razor {3.2.3}
Microsoft.AspNet.Web.Optimization {1.1.3}
Microsoft.AspNet.WebApi {5.2.3}
Microsoft.AspNet.WebApi.Client {5.2.3}
Microsoft.AspNet.WebApi.Core {5.2.3}
Microsoft.AspNet.WebApi.WebHost {5.2.3}
Microsoft.AspNet.WebHelpers {3.2.3}
Microsoft.AspNet.WebPages {3.2.3}
Microsoft.AspNet.WebPages.Data {3.2.3}
Microsoft.AspNet.WebPages.WebData {3.2.3}
Microsoft.Bcl {1.1.10}
Microsoft.Bcl.Build {1.0.14}
Microsoft.CodeDom.Providers.DotN... {1.0.0}
Microsoft.Data.Edm {5.6.0}
Microsoft.Data.OData {5.6.0}
Microsoft.Data.Services.Client {5.6.0}
Microsoft.Net.Compilers {1.0.0}
Microsoft.Net.Http {2.2.29}
Microsoft.Owin {3.0.1}
Microsoft.Owin.Host.SystemWeb {3.0.1}
Microsoft.Owin.Security {3.0.1}
Microsoft.Owin.Security.Cookies {3.0.1}
Microsoft.Owin.Security.OAuth {3.0.1}
Microsoft.Web.Infrastructure {1.0.0.0}
Microsoft.WindowsAzure.Configura... {1.8.0.0}
MiniProfiler {2.1.0}
MySql.Data {6.9.8}
Newtonsoft.Json {6.0.8}
Owin {1.0}
semver {1.1.2}
SharpZipLib {0.86.0}
System.Spatial {5.6.0}
UmbracoCms {7.3.1}
UmbracoCms.Core {7.3.1}
WebGrease {1.5.2}
WindowsAzure.Storage {3.2.1}
xmlrpcnet {2.5.0}

EDIT 2: I tried downgrading NuGet from 3.2.6 to 3.0.6, but nothing changed.

EDIT 3: Installed VS2013, and tried to use NuGet 2.8, but I still get the same issue

EDIT 4: Tried to run the following command in the Package Manager Console after the error occurs. Here is the result from VS2013/NuGet 2.9

$error[0].Exception.StackTrace
   at NuGet.PackageRepositoryHelper.ResolvePackage(IPackageRepository sourceRepository, IPackageRepository localRepository, IPackageConstraintProvider constraintProvider, String packageId, SemanticVersion version, Boolean allowPrereleaseVersions)
   at NuGet.VisualStudio.VsPackageManager.InstallPackage(IProjectManager projectManager, String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions, Boolean skipAssemblyReferences, ILogger logger)
   at NuGet.VisualStudio.VsPackageManager.InstallPackage(IProjectManager projectManager, String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions, ILogger logger)
   at NuGet.PowerShell.Commands.InstallPackageCommand.InstallPackage(IVsPackageManager packageManager)
   at NuGet.PowerShell.Commands.InstallPackageCommand.ProcessRecordCore()
   at NuGet.PowerShell.Commands.NuGetBaseCommand.ProcessRecord()

From VS2015/NuGet 3.2 there is no result from $error[0].Exception.StackTrace


Solution

  • TL;DR: Use the GUI package manager in VS2013 with NuGet 2.8

    It's not a great solution, but I found something that works..

    I installed VS2013 and NuGet 2.8. At first, this did not work either, but I tried to use the GUI package manager instead of the console, and that worked.

    I'm not sure if this is a VS2015 / NuGet 3.2 issue, or what actually is the cause of the problem. VS2015 + NuGet works fine in other projects where I'm not running uCommerce. Maybe it's a NuGet 3.2 / Ucommerce issue, I don't know..

    Hopefully this gets fixed in a later version of NuGet/Visual Studio/uCommerce, but for now I'll run VS2013 for all NuGet-stuff.