Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuget-license does not find packages on Windows Server 2019 Standard 1809 #154

Open
RoelandNEC opened this issue Feb 12, 2025 · 4 comments

Comments

@RoelandNEC
Copy link

We are using nuget-license to generate automatically a list of used third party software with our NEC application.
On a development system this works OK, but on the build server not.
Input is the same BCT Agent.csproj file.

Development system: Windows 10 Pro 22H2
D:\trunk> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.36 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.12 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Build server Windows Server 2019 Standard 1809
E:\trunk> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.27[C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.27 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 9.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Output from build server:
+------------------------------------+-------------------------------+
| Package | Version | License Information Origin |
+------------------------------------+-------------------------------+
+------------------------------------+-------------------------------+

Output from development system:
D:\Trunk>nuget-license --version
3.1.1

D:\Trunk>nuget-license -i "D:\trunk\BCT_Agent\BCT Agent\BCT Agent.csproj"
+------------------------------------+---------+
| Package | Version |
+------------------------------------+---------+
| Microsoft.AspNet.SignalR.Client | 2.4.3 |
| Microsoft.Extensions.Logging.Debug | 9.0.1 |
| Microsoft.Maui.Controls | 9.0.30 |
| Microsoft.NET.ILLink.Tasks | 9.0.1 |
| Newtonsoft.Json | 13.0.3 |
+------------------------------------+---------+
(I removed everything after version.)

Remove txt from the attached file to try yourself.
BCT Agent.csproj.txt

Notes:

  1. The problem depends likely also on the contents for the csproj file, because other csproj files do work on the Build server Windows Server 2019 Standard.
  2. The predecessor dotnet-project-licenses.exe version 2.7.1 does give correct contents with BCT Agent.csproj on the Build server Windows Server 2019 Standard.

Please have a look at this.
Thanks,

Roeland

@sensslen
Copy link
Owner

sensslen commented Feb 12, 2025

Thanks a lot for reporting. Would you be able to provide a small reproduction example? Github provides runners based on Windows Server 2019. https://github.com/actions/runner-images/blob/main/images/windows/Windows2019-Readme.md

Unfortunately it will be exceptionally hard to track this down without a way to reproduce the issue.

In general the app works as expected in all scenarios that are ran by the CI pipeline - See https://github.com/sensslen/nuget-license/actions/runs/13277124918/job/37068671976 and https://github.com/sensslen/nuget-license/actions/runs/13277124918/job/37068669986. Granted - one ran on ubuntu

@RoelandNEC
Copy link
Author

The problem can be related with "Empty Output after 3.1.0 update" #148.
But I do use version 3.1.1 where #148 is solved and this does not explain why on my development system the problem does not occur.

A colleague of mine also reproduced the problem on a Windows 11 system.
Very likely you will be able to reproduce the problem with the attached BCT Agent.csproj file (just remove .txt) and give command:
CMD>nuget-license -i "BCT Agent.csproj"
Is it possible to get traces out of nuget-license? Then I will be able to give traces from my good working system.

@sensslen
Copy link
Owner

The problem is not related to #148, as that was only happening for solution files, not project files.

@sensslen
Copy link
Owner

No traces have been implemented to nuget-license so far. I'll have a look when I get time. However if you want a fix sooner, feel free to download the code and debug it. Any Pull-Request will be highly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants