PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

Better Support for Nuget Dependencies for Binary Modules

Open aersam opened this issue 4 years ago • 2 comments

Port of https://github.com/PowerShell/PowerShell/issues/15588

Summary of the new feature/enhancement

Powershell Package Authoring in C#/.Net is a very unsatisfying task for anything that relies on complex Nuget Packages. As an example: It's nearby impossible to get a package working on Powershell Gallery that relies on the Nuget Package of the SQL Server Driver (Microsoft.Data.SqlClient). I have to reference platform specified dll's somehow and it requires a lot of code just to get that dll working. The SQL Server Module

In addition, as a Powershell package can only have dependencies from PowershellGallery (de-facto), it's common to include the .Net DLLs in the Package, see SqlServer Module for example. If two packages include the same dll's we have a conflict. As an example, the SqlServer Module mentioned uses Newtonsoft.Json which should be fairly common to include.

Proposed technical implementation details

I'd propose to support Nuget Dependencies directly in the Manifest Files (psd1).

aersam avatar Jun 18 '21 07:06 aersam

As the owner of the SQLServer module and due to my close proximity to the Microsoft.Data.SqlClient folks, I really hope to see this addressed soon. :)

Matteo-T avatar Oct 11 '22 18:10 Matteo-T

This made me move away from Powershell for almost everything. I code now everything with more than a few lines completely in C#. I would prefer to have generic .net dlls/nuget packages and use PowerShell for the Business Logic

aersam avatar Oct 11 '22 19:10 aersam

What's the best practice workaround to this issue?

Viajaz avatar Jan 31 '23 00:01 Viajaz