azure-cost-cli icon indicating copy to clipboard operation
azure-cost-cli copied to clipboard

.net framework 6.0 ?

Open championchunk opened this issue 1 year ago • 11 comments

Hey there, unfortunately i can't run the script anymore from Azure CLI:

You must install or update .NET to run this application.

App: /home/tom/.dotnet/tools/azure-cost Architecture: x64 Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64) .NET location: /usr/share/dotnet

The following frameworks were found: 7.0.16 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 8.0.2 at [/usr/share/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=6.0.0&arch=x64&rid=linux-x64&os=mariner.2.0

How can i fix this ?

championchunk avatar Mar 19 '24 10:03 championchunk

Thanks for opening your first issue! Reports like these help improve the project!

welcome[bot] avatar Mar 19 '24 10:03 welcome[bot]

I dropped the .NET 7 support (https://github.com/mivano/azure-cost-cli/commit/4114a6a64746f4c215986a79d832c5d585423085) as it is not a long-term supported version and will be end of support soon.

But still; you do have .net 8 installed, so that is what it should use. Can you reinstall version 8?

mivano avatar Mar 19 '24 11:03 mivano

@championchunk any luck? Were you able to solve this issue?

mivano avatar Apr 01 '24 18:04 mivano

@mivano unfortunately not.. according to the message the command is searching for .Net 6 but i only have .Net 7 and .Net 8 installed.

championchunk avatar Apr 02 '24 09:04 championchunk

Do you have the latest version? Did you try an upgrade?

dotnet tool update --global azure-cost-cli 

mivano avatar Apr 02 '24 11:04 mivano

yes i updated to version 0.39.0 but the message remains the same:

You can invoke the tool using the following command: azure-cost Tool 'azure-cost-cli' (version '0.39.0') was successfully installed. PS /home/username> azure-cost detectAnomalies -s 2b9fea8e-4bbe-48fc-a9c0-a159dbd4d14c --dimension ResourceGroupName --significant-change 0.1 --recent-activity-days 5 --threshold-cost 10 You must install or update .NET to run this application.

App: /home/username/.dotnet/tools/azure-cost Architecture: x64 Framework: 'Microsoft.NETCore.App', version '6.0.0' (x64) .NET location: /usr/share/dotnet

The following frameworks were found: 7.0.16 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 8.0.2 at [/usr/share/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=6.0.0&arch=x64&rid=linux-x64&os=mariner.2.0

championchunk avatar Apr 02 '24 11:04 championchunk

@mivano Having the sam issue. Any update?

brave187 avatar Apr 05 '24 07:04 brave187

Sorry not yet. I cant reproduce it, so will need some more time.

mivano avatar Apr 09 '24 11:04 mivano

weird one. I tested installing on Ubuntu 22.04 via global and local with only dotnet 8 SDK installed (8.0.5) and works fine. I assume you are installing using global flag? Have you tried uninstall command and then install again? Making sure the executable file is removed when uninstalled. (executable would be /home/tom/.dotnet/tools/azure-cost) I would also try uninstalling dotnet 7 and ensuring you only have latest dotnet 8 SDK installed.

Checking the build of azure-cost-cli it builds for dotnet 6 and dotnet 8 - not sure how the tool decides which one to pull or if both are packaged in same executable.

Another option is to install dotnet 6 SDK?

DanielSpindler83 avatar May 28 '24 05:05 DanielSpindler83

I got this to work as a workaround using this env var: export DOTNET_ROLL_FORWARD=Major.

This was in the azure cloud shell which has both 7.0 and 8.0 installed: The following frameworks were found: 7.0.17 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] 8.0.3 at [/usr/share/dotnet/shared/Microsoft.NETCore.App]

MvRoo avatar May 28 '24 11:05 MvRoo

Thanks for checking. The Nuget page shows that 6 and 8 are included.

That tip for uninstalling and reinstalling might be something. The Nuget package contains both, so maybe during installation, it places one in a dedicated folder on the path?

mivano avatar May 28 '24 20:05 mivano

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 26 '24 21:08 stale[bot]