Issue: nuget gsudo is copying the executable and runtime folders to osx and others
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
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.
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>
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(''))" />