PowerShell / PowerShellGetv2

PowerShellGet is the Package Manager for PowerShell
https://www.PowerShellGallery.com
MIT License
431 stars 138 forks source link

Publish-Module keeps reporting it can't build the NuGet package #51

Closed jianyunt closed 7 years ago

jianyunt commented 7 years ago

From @heaths on August 15, 2015 16:54

Whenever I try to run publish-module on a valid module with strong-named signed assemblies, I get various errors. First it was reporting that Find-Module couldn't find my module (well, yeah - I was trying to publish the first version). If I modified psget.psm1 to ignore that error, later I was getting errors on line 2880 of psget.psm1 (on Win10 RTM). NuGet reported that a type couldn't be loaded (whether I used a loaded module, discovered module, or directory path) but no errors in the $Error collection contained the LoaderException referenced (apparently this exception occurred in the NuGet process). I modified psget.psm1 to spit out the $nospec variable and used nugget 2.8.6 (in my PATH, if that matters for the error at hand) to build a .nupkg successfully. I pushed that via "nuget push" and finally got it published myself. But then Install-Module failed with the same error!

As a test, I tried using Install-Module on PSReadline and that also failed with the same error.

I'm on Win10 RTM with all updates applied, and had VS2013 and VS2015 (which has nuget v3, but should be completely isolated currently) with nuget 2.8.6 in my path.

I tried to update PackageManagement and PowerShellGet via the PackageManagement module but it reported they were up to date (for the former) or not found (for the latter).

Copied from original issue: OneGet/oneget#146

jianyunt commented 7 years ago

From @Jaykul on August 16, 2015 6:45

Is your module code posted anywhere? ;-)

It sounds like you may have a problem with your module manifest (.psd1) -- do you have anything in RequiredModules (or NestedModules)?

For what it's worth, the nuget that PackageManagement (aka OneGet) is using is stored in AppData\Local\PackageManagement\ProviderAssemblies and it's v2.8.5.21 (at least on my box).

It's probably worth pointing out -- although you may realize this, and it doesn't matter much to me ;-) that the problem you're having is most likely not a OneGet problem, it's a PowerShellGet problem, and that team isn't really on github yet, as far as I know they're still testing the open source waters with DSC modules and not much else, and they're still using Connect for bug reports.

jianyunt commented 7 years ago

From @heaths on August 17, 2015 9:8

It's the "msi" module on powershellgallery.com.

Thanks for the tip about Connect. I wasn't sure who owned it, and saw a PowerShellGet directory in the OneGet sources so thought maybe they had taken it over.

jianyunt commented 7 years ago

From @heaths on August 17, 2015 9:11

Just as a follow up, posted to https://connect.microsoft.com/PowerShell/feedbackdetail/view/1678384/publish-module-keeps-reporting-it-cant-build-the-nuget-package.

bmanikm commented 7 years ago

@heaths Please verify this issue with the latest version of PowerShellGet from the PSGallery. Reopen this if reported issue is not resolved.