Home Blog .NET Error Install-Package StructureMap -version 4.4.2
Error Install-Package StructureMap -version 4.4.2
.NET
Written by Dicky   
Wednesday, 01 February 2017 11:46
AddThis Social Bookmark Button

I'm trying to install the latest StructureMap in order to utilize their update Unit test capability.

However, when I tried to install the latest version using NuGet Package Manager Console, it gave me the following error message:

PM> Install-Package StructureMap -version 4.4.2
Attempting to gather dependencies information for package 'StructureMap.4.4.2' with respect to project 'Infrastructure\Infrastructure.MessageServiceProvider.UnitTests', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'StructureMap.4.4.2' with DependencyBehavior 'Lowest'
Resolving actions to install package 'StructureMap.4.4.2'
Resolved actions to install package 'StructureMap.4.4.2'
Install failed. Rolling back...
Package 'structuremap 4.4.2' does not exist in project 'Infrastructure.MessageServiceProvider.UnitTests'
Install-Package : An error occurred while downloading package 'structuremap 4.4.2' from source 'xxx'.
At line:1 char:1
+ Install-Package StructureMap -version 4.4.2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Apparently, I need to use the latest version of NuGet in order to be able to download and install that version of StructureMap. The NuGet version that I'm using is 3.1.0 and after I ran the following command:

nuget update -self
which updates the version to NuGet 3.5.0. Afterward, I was able to download, install the missing NuGet packages and build the project just fine.