admin管理员组

文章数量:1310480

If I publish my C# Binary PowerShell module like this, it works.

dotnet publish -c Release
Push-Location ".\Module\bin\Release\net7.0\publish"
Publish-Module -Name .\ImportIcal.psd1 -NuGetApiKey (Get-Secret NuGetApiKey -AsPlainText )
Pop-Location

However, if I try instead

dotnet publish -c Release
Push-Location ".\Module\bin\Release\net7.0"
Publish-Module -Name .\ImportIcal.psd1 -NuGetApiKey (Get-Secret NuGetApiKey -AsPlainText )
Pop-Location

Raises the exception:

Test-ModuleManifest: The specified RequiredAssemblies entry 'Ical.Net.dll' in the module manifest.

Is is logical enough as the dependencies are not restored to the net7.0 directory and only to the publish directory. However, this causes all of my dependencies being zipped into the NuGet package on the PowerShell gallery.

Is it possible possible to install the dependency tree from NuGet rather than include them in the package, it seems a bit wasteful and bloated.

本文标签: nugetPowerShell Binary Module DependenciesStack Overflow