maxmind/GeoIP2-dotnet

Installation doesn't work

jvaldezjr1 opened this issue · 2 comments

Running PowerShell 7, and 5.1
NuGet repo is set to api.nuget.org/v3

install-package MaxMind.GeoIP2 gives errors:
`Install-Package : The current environment doesn't have a solution open.
At line:1 char:1

  • Install-Package MaxMind.GeoIP2
  •   + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
      + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand`
    
    

Downloading the nupkg and installing doesn't work either. The nupgk site lists v2 api endpoint, and using v3 I can't find nor install the package.

It sounds like you aren't installing the library in a project. You need to first open your solution. This is only intended to be used as a library.

am11 commented

NuGet.org's page (https://www.nuget.org/packages/MaxMind.GeoIP2/) shows different methods of adding a dependency to the project. e.g. if we have dotnet-cli installed, then we can use it to add package (or project-to-project) references using PowerShell, CMD or Unix shell:

$ cd <path to directory where .sln or .csproj file is situated>
$ dotnet add package MaxMind.GeoIP2
  # to install latest version of this library

or without changing the directory, the syntax is:

$ dotnet add <path to project/solution dir> package MaxMind.GeoIP2