gsudo icon indicating copy to clipboard operation
gsudo copied to clipboard

Issue: nuget gsudo is copying the executable and runtime folders to osx and others

Open sn4k3 opened this issue 9 months ago • 2 comments

Issue Description

"C:\Program Files\dotnet\dotnet.exe" publish project --configuration Release --self-contained true --property:PublishReadyToRun=true --runtime osx-x64 --output artifacts\publish\osx-x64_v0.0.1

Image

Steps to Reproduce

Publish ready to run to osx or linux with gsudo nuget in solution dotnet add package gsudo --version 2.6.0

Build system

Windows 11 with dotnet 9

Expected

gsudo only included in universal publish and under windows.

sn4k3 avatar Mar 10 '25 21:03 sn4k3

I dont have a clear picture of what would the best behaviour of the Nuget package be before making a change here. I need to research a little bit, and I accept feedback.

On the other hand you can temporarily handle this issue on your side by adding a conditional reference to gsudo nuget package:

  <ItemGroup Condition="$(RuntimeIdentifier.StartsWith('win'))">
    <PackageReference Include="gsudo" Version="2.6.0" />
  </ItemGroup>

gerardog avatar Mar 12 '25 12:03 gerardog

I had a look into your nuget package, but I also have no clue... In my mind, when you publish a project, everything inside runtime/RID get copied over to root and runtime folder is excluded from copy, but is not the case with gsudo somehow.

I have another C# project (used from dotnet5, 6 and now 9) that always worked fine with other nuget package that library have runtimes for windows, linux and macos, I reference them all in my solution and on publish time the correct runtime is copied to the root and I never get a runtime folder nor wrong dependency for the given rid.

Thanks for providing a solution, that will help with the workflow. I need to include empty runtime, due universal build and while developing builds.

<PackageReference Include="gsudo" Version="2.6.0" Condition="$(RuntimeIdentifier.StartsWith('win')) Or $(RuntimeIdentifier.Equals(''))" />

sn4k3 avatar Mar 12 '25 16:03 sn4k3