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

Make into a dotnet tool? #8

Open
derekantrican opened this issue Jan 24, 2022 · 9 comments
Open

Make into a dotnet tool? #8

derekantrican opened this issue Jan 24, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@derekantrican
Copy link

derekantrican commented Jan 24, 2022

The dotnet CLI has a handy feature of "tools" (like extensions). I could see this being a very useful one. It would make your tool very easy to install & use.

https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools
https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools-how-to-create

@jmalarcon
Copy link
Owner

Hi Derek:

In fact you already have this built-in in dotnet: dotnet --list-sdks

This will give you all the installed .NET SDK versions in your computer.

If you want to know all the installed .NET runtimes you can use: dotnet --list-runtimes

The whole point of creating my tool was to have something similar in the "classic" .NET framework, where knowing this information is not straightforward.

HTH

@derekantrican
Copy link
Author

Yes, I am aware of dotnet --list-runtimes but this only lists the .NET Core runtimes (now just called ".NET"). That is why I suggested to you to build a tool using your code: for .NET Framework runtimes

@jmalarcon
Copy link
Owner

Ah!, OK. So what you're proposing, if I understood it correctly, is to create a .NET version that apart from showing the same that --list-runtimes shows, it includes the old .NET framework versions too in the result. Is that correct?

It shouldn't be difficult to pull out in Windows with the Microsoft.Win32.Registry package, I guess. It should return the same as --list-runtimes + .NET framework versions in Windows, and just the same as --list-runtimes in other operating systems...

Thanks for the suggestion.

@jmalarcon jmalarcon reopened this Jan 25, 2022
@jmalarcon jmalarcon added the enhancement New feature or request label Jan 25, 2022
@derekantrican
Copy link
Author

derekantrican commented Jan 25, 2022

Right. Per my links above, I think this would fit well as a "tool" that could be called via the dotnet CLI. Currently to see a list of installed .NET Frameworks on a computer, a user has to run something like

Powershell

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse | Get-ItemProperty -name Version,Release -EA 0 | Where { $_.PSChildName -match '^(?!S)\p{L}'} | Select PSChildName, Version, Release

https://stackoverflow.com/a/3495491/2246411

which is horrendous. Additionally, everywhere I look there seems to be caveats for 4.5+ or <=1 because of how the registry is organized differently for those versions. Someone could install your tool, but that's an additional thing to install.

However, if they happen to already have the dotnet CLI installed, I think it would be cool if they could run something like the following:

dotnet tool install list-frameworks
dotnet tool list-frameworks

Much simpler. Much cleaner.

@jmalarcon
Copy link
Owner

You're right. Thanks for the suggestion.

I don't know I I'll have the time soon to do something like that, but I keep the idea here for doing sometime in the future 😊

@tisaconundrum2
Copy link

+1 to you also adding this to the CLI in the future! :)

@Burzyn1
Copy link
Contributor

Burzyn1 commented Sep 18, 2022

+1

@bgrossman
Copy link

You're right. Thanks for the suggestion.

I don't know I I'll have the time soon to do something like that, but I keep the idea here for doing sometime in the future 😊

I'm happy to take a stab unless you'd prefer to do it?

@jmalarcon
Copy link
Owner

By all means, thank you. Just do a PR and I'll be happy to review and accept it. Thanks!

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

No branches or pull requests

5 participants