4

I installed a package using nuget in PowerShell:

PS > install-package gudusoft.gsqlparser -source https://www.nuget.org/api/v2

Which installed DLL in this location:

/usr/local/share/PackageManagement/NuGet/Packages/gudusoft.gsqlparser.3.2.6.5/lib/netcoreapp2.0/gudusoft.gsqlparser.dll

I referencing the DLL in the module's manifest (psd1):

RequiredAssemblies = @('gudusoft.gsqlparser.dll')

When I load the module that uses the DLL, I get an error:

PS > import-module pssqlparser                    
import-module : Could not load file or assembly 'gudusoft.gsqlparser, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

I can probably load the assembly directly:

Add-Type -Path '/usr/local/share/PackageManagement/NuGet/Packages/gudusoft.gsqlparser.3.2.6.5/lib/netcoreapp2.0/gudusoft.gsqlparser.dll'

Another option, I suppose, it to add the Packages folder to the $PATH.

Is there an idiomatic way to address this issue in PowerShell?

craig
  • 25,664
  • 27
  • 119
  • 205
  • 2
    You can just unzip package and copy dll to your module folder. no need to run install-package. This works just fine for me – Mike Twc Dec 05 '18 at 04:21

0 Answers0