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

Add support for .NET8 #200

Open
sabifa opened this issue Nov 20, 2023 · 20 comments
Open

Add support for .NET8 #200

sabifa opened this issue Nov 20, 2023 · 20 comments

Comments

@sabifa
Copy link

sabifa commented Nov 20, 2023

I have just upgraded my project to .NET 8 and noticed while running my build pipeline in Azure DevOps that it fails because of dotnet-project-licenses.

Output:

You can invoke the tool using the following command: dotnet-project-licenses
  Tool 'dotnet-project-licenses' (version '2.7.1') was successfully installed.
  You must install or update .NET to run this application.
  
  App: C:\Users\VssAdministrator\.dotnet\tools\dotnet-project-licenses.exe
  Architecture: x64
  Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
  .NET location: C:\hostedtoolcache\windows\dotnet
  
  The following frameworks were found:
    8.0.0 at [C:\hostedtoolcache\windows\dotnet\shared\Microsoft.NETCore.App]
  
  Learn more:
  https://aka.ms/dotnet/app-launch-failed
  
  To install missing framework, download:
  https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=7.0.0&arch=x64&rid=win-x64&os=win10
D:\a\1\s\Festivalmanager\Festivalmanager.csproj(28,9): error MSB3073: The command "dotnet-project-licenses" exited with code -2147450730.
@pedroveiga99
Copy link

Yes, the very same thing happened to me. It would be fantastic if support for .NET8 was added.

@bsuchorowski
Copy link

Same story on our side. We have just introduced a first dotnet 8.0 app.

@svenclaesson
Copy link
Collaborator

svenclaesson commented Nov 22, 2023

It would be nice with .net8 support but this does not need to be a blocker.
Just install both .net8 and .net7 sdk side by side

@sensslen
Copy link
Collaborator

I opened #201 which includes .net8 to the version 3 alpha. I'm currently considering to release that version, but I need at least one affirmative review.

@pedroveiga99
Copy link

It would be nice with .net8 support but this does not need to be a blocker. Just install both .net8 and .net7 sdk side by side

Yes, this works. But I think is more a temporary workaround than a good solution.

I opened #201 which includes .net8 to the version 3 alpha. I'm currently considering to release that version, but I need at least one affirmative review.

Nice. I looking forward for this new version!

@sensslen
Copy link
Collaborator

@sensslen
Copy link
Collaborator

sensslen commented Dec 9, 2023

I just released https://www.nuget.org/packages/nuget-license. This is a release of my fork of v3.0.0 of this tool. Unfortunately @tomchavakis has been unresponsive for quite some time and the nuget api key expired which means I was unable to release in the original form.

@belav
Copy link

belav commented Dec 13, 2023

@sensslen is there any documentation on the changes in 3.0.0? I can't find any of the following CLI options. And looking at the code it seems like 3.0 is completely different than 2.7.1

-u
-outfile # possibly just need to pipe the output of the command to a file
--projects-filter
--manual-package-information
--packages-filter

Alternatively, is it possible to publish a 2.7.2 that adds a net8 target? The project seems to build fine with adding that target.

@sensslen
Copy link
Collaborator

sensslen commented Dec 14, 2023

@sensslen is there any documentation on the changes in 3.0.0? I can't find any of the following CLI options. And looking at the code it seems like 3.0 is completely different than 2.7.1

-u

-outfile # possibly just need to pipe the output of the command to a file

--projects-filter

--manual-package-information

--packages-filter

Alternatively, is it possible to publish a 2.7.2 that adds a net8 target? The project seems to build fine with adding that target.

@belav you are right that version 3 is very different. It addresses some long standing issues. The documentation is available on nuget.org. All available command line options are listed. See https://www.nuget.org/packages/nuget-license. I'm not able to publish the original nuget, as I don't have the api key. Also I see no value in republishing version 2 under my name.

@belav
Copy link

belav commented Dec 14, 2023

Also I see no value in republishing version 2 under my name.

I tried to figure out how we can convert our command to use 3.0.0. I started with the basics and just output some json by pointing both dotnet-project-licenses and nuget-licenses at our root Microsoft.Build.Traversal project. The new version 3.0.0 only gets two project licenses and there should be a lot more.

Being that there is no documentation telling me how 2.7.1 differs from 3.0.0, if there was a 2.7.2 published that worked with net8, I would just use that. That is where the value comes in, at least for consumers of the project. Being that you are taking on the project I understand why you may not want to support the older version.

I ended up building a 2.7.2 myself and committing the nupgk to our repo. If anyone else goes that route, dotnet tool restore doesn't seem to respect a NuGet.config, and you need to run the command with --add-source

I also wanted to say thank you for taking on support of this, I do appreciate it.

@sensslen
Copy link
Collaborator

Also I see no value in republishing version 2 under my name.

I tried to figure out how we can convert our command to use 3.0.0. I started with the basics and just output some json by pointing both dotnet-project-licenses and nuget-licenses at our root Microsoft.Build.Traversal project. The new version 3.0.0 only gets two project licenses and there should be a lot more.

Being that there is no documentation telling me how 2.7.1 differs from 3.0.0, if there was a 2.7.2 published that worked with net8, I would just use that. That is where the value comes in, at least for consumers of the project. Being that you are taking on the project I understand why you may not want to support the older version.

I ended up building a 2.7.2 myself and committing the nupgk to our repo. If anyone else goes that route, dotnet tool restore doesn't seem to respect a NuGet.config, and you need to run the command with --add-source

I also wanted to say thank you for taking on support of this, I do appreciate it.

It looks as if you missed the -t flag which also prints transitive dependencies. I'm fine if you want to use the old version of the tool. Keep in mind though that the results may not be accurate due to the fact that version 2 uses a homegrown algorithm to determine the version of a nuget package used, where as v3 uses the nuget internal algorithm. This was actually what made me write version 3.

@trampster
Copy link

trampster commented Dec 20, 2023

@sensslen your new tool crashes when we try and use it and your new repo has no way to report issues. Can you please turn on issue reporting?

@sensslen
Copy link
Collaborator

@trampster Issues are now turned on on the fork. Can you please report the issue you're seeing?

@sabifa
Copy link
Author

sabifa commented Jan 8, 2024

I just released https://www.nuget.org/packages/nuget-license. This is a release of my fork of v3.0.0 of this tool. Unfortunately @tomchavakis has been unresponsive for quite some time and the nuget api key expired which means I was unable to release in the original form.

Thank you for your work! Unfortunately nuget-license is, as of now, not a suitable replacement for this package. There are core features of this package missing, for example:

  • --convert-html-to-text (closed issue as wont do)
  • ability to define an output folder/file

@sensslen
Copy link
Collaborator

sensslen commented Jan 8, 2024

@sabifa feel free to submit Pull Requests in order to improve here: https://github.com/sensslen/nuget-license. Also I don't quite understand your second concern, as the download location for the licenses can be defined....

@Suneeh
Copy link

Suneeh commented Jan 8, 2024

I would love to see a new version of this, since I updated my repos to .NET8 my Pipeline run fails.

@sensslen
Copy link
Collaborator

sensslen commented Jan 8, 2024

I would love to see a new version of this, since I updated my repos to .NET8 my Pipeline run fails.

@Suneeh There you go: https://www.nuget.org/packages/nuget-license

@Suneeh
Copy link

Suneeh commented Jan 9, 2024

@sensslen thanks.. doesn't quite work for me, can you provide an example of an --override-package-information json? Or does it not take a json file?

@sensslen
Copy link
Collaborator

sensslen commented Jan 9, 2024

@sensslen thanks.. doesn't quite work for me, can you provide an example of an --override-package-information json? Or does it not take a json file?

@Suneeh
https://github.com/sensslen/nuget-license/blob/main/.github/workflows/assets/Tests/overwritePackageInformation.json
I know the documentation is pretty basic for now. Feel free to improve here. I'll be happy to accept Pull Requests.

@Suneeh
Copy link

Suneeh commented Jan 9, 2024

Yea just found that as well !
Thanks though. I might consider it after rewriting my projects to this nuget package ^^

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

8 participants