04 Feb 2021
cant install dotnet tool install --global dotnet-aspnet-codegenerator - blazor solved
dotnet tool install --global dotnet-aspnet-codegenerator
So.. do you have problem about to install blazor with run command : dotnet tool install --global dotnet-aspnet-codegenerator ?? and then shell terminal showing error display like this :
error NU1202: Package dotnet-aspnet-codegenerator 5.0.1 is not compatible with n
etcoreapp3.1 (.NETCoreApp,Version=v3.1) / any. Package dotnet-aspnet-codegenerat
or 5.0.1 supports: net50 (.NETFramework,Version=v5.0) / any
The tool package could not be restored.
Tool 'dotnet-aspnet-codegenerator' failed to install. This failure may have been
caused by:
* You are attempting to install a preview release and did not use the --version
option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet con
nection problem.
* You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/fai
lure-installing-tool
Halo kaka gaes.. jika kamu pernah ngalamain kendala seperti pada waktu nggunaain blazor dengan kesalahan seperti diatas alias gak bisa di gunaian perintah nya, maka kamu gak perlu kawatir,,, tenang,,, seruput kopi mu bentar dan hisap rokok mu lebih dalam agar lebih tenang... ini cobaan harap sabar... lah trus kapan bisa nyelesain masalah ini bro.,. sabar sabar aja loe toe ye.... :D . Bersambung........
If you have same error like this, you should not be to worry , this is only about version blazor your installation. because you install on lastest version, so this apps can be install with your version or not compaitable, what can i do ?? for first you need to know about blazor version your computer desktop, then you can re run with version of blazor your using, how to check version ?? you just need open shell terminal then run command :
dotnet --info
For example with version 3 so shell terminal will displaying code like this
$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: xxxxxxxxx
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19041
OS Platform: Windows
RID: win10-x86
Base Path: C:\Program Files (x86)\dotnet\sdk\3.1.100\
Host (useful for support):
Version: 3.1.0
Commit: xxxxxxxxxxxx
.NET Core SDKs installed:
3.1.100 [C:\Program Files (x86)\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Now you can see the blazor dot net version your installed , on this example we use version 3.1.0 right.. the solutions is you can install blazor new version or using this version, if you need using this version so you can run command again with version your using. for this example you can run shell npm terminal again with code like this :
dotnet tool install --global dotnet-aspnet-codegenerator --version 3.1.0
On command line you see we just need install with version on your terminal pc desktop so run with --version (your dotnet version). that's it and installation is successfully.
Oke kaka kaka bapak bapak dan ibu ibu sekalian embak embak tuan tuan... permasalaahn mengenai cant install dotnet tool install --global dotnet-aspnet-codegenerator ini sebenarnya masalah sepele doang, jadi kalian gak perlu kawatir berlebihan, gak perlu install ulang pc ya.. kita ingetin kalau install ulang pc capek nanti musti masukin aplikasi lagi,, waktunya juga lama ya kan.. wkwkww.... sabar sabar.... jadi gini.. untuk permasalah ini lebih baik kita serahkan ke yang bersangkutan untuk menyelesaikan secara kekeluargaan.. apa sih in kok gak nyambung ama skali.. :D
nah pastikan aja deh ketika kamu ngedapati masalah seperti diatas artinya versi kamu gak didukung alias kamu salah untuk installasi versi nya, jadi jalan terbaik kamu bisa cek dulu versi yang kamu gunakan pada contoh diatas makai versi 3 jadi gak mungkin dong bisa makai yang versi 5 , maka jalan terbaik kamu bisa uninstal dotnet blazor atau menginstall menggunakan versi kamu. kalau saran sih mendingan makai versi lama biar gak beribet banget, nah gimana sekarang caranya cek versi yang kamu gunakan, tinggal masukan aja perintah seperti diatas. nah setelah ketauan versi yang kamu gunain sekarang kamu bisa lakukan installasi dengan menambahkan perintah -- versi yang kamu gunakan. dan setelah itu sukses deh kamu bisa ngegunain nya..