Electron.net: Unable to resotre DotNetCLI Reference

Created on 3 Nov 2017  路  12Comments  路  Source: ElectronNET/Electron.NET

I grabbed a copy of the Music Player application written by you.

when i run the command dotnet electronize init i get an error.

image

I have tried running dotnet restore prior to this. I have .Net Core 2.0 SDK installed and am using Visual Studio 2017.

question

Most helpful comment

Try the default CMD.exe (Command Shell) - I got the same mysterious effects with PowerShell..

All 12 comments

Could you a "dotnet restore"?

Ive tried that but that doesnt seem to add the CLI reference.

After i run "dotnet restore", the dependencies folder does not have the Electron.CLI under Nuget.

image

This is (sadly) by design. CLI extensions can only be added through the .csproj and are not visible like other NuGet packages in VS.

I just cloned the project and it should look like something like this:

PS D:\Code\GitHub\electron.net-musicplayer-sample> dotnet restore
Restoring packages for D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj...
Restoring packages for D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj...
Installing ElectronNET.CLI 0.0.5.
Restore completed in 1.53 sec for D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj.
Installing ElectronNET.API 0.0.5.
Generating MSBuild file D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\obj\MyElectronMusicPlayer.csproj.nuget.g.props.
Generating MSBuild file D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\obj\MyElectronMusicPlayer.csproj.nuget.g.targets.
Restore completed in 6.43 sec for D:\Code\GitHub\electron.net-musicplayer-sample\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj.
PS D:\Code\GitHub\electron.net-musicplayer-sample>

This is what my command outputs:

image

I do have the dotnetclireference in the .csproj. I assumed it would show up in that list if it actually got installed correctly. For me it is not even installing hte CLI reference.

Do i need to have anything else installed besides .NET Core 2.0 SDK?

And dotnet electronize version doen't work? Maybe the Electron.NET CLI is already installed - it's hard to see from VS if it is there or not.

i cant use any of the dotnet electronize commands

Could you check if you have a electronnet.cli folder in the NuGet Cache?
Location: %userprofile%/.nuget/packages
And here: %userprofile%/.nuget/packages/.tools

If yes: Try to remove the electronnet.cli package there and do a new dotnet restore.

I just removed it and i got this:

PS C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master> dotnet restore --force
Restoring packages for C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj...
Restoring packages for C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj...
Restore completed in 991.71 ms for C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj.
Installing ElectronNET.CLI 0.0.5.
Restore completed in 1.63 sec for C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master\MyElectronMusicPlayer\MyElectronMusicPlayer.csproj.
PS C:\Users\hiteshkpatel\Desktop\electron.net-musicplayer-sample-master> dotnet electronize init
No executable found matching command "dotnet-electronize"

Try the default CMD.exe (Command Shell) - I got the same mysterious effects with PowerShell..

oh man that worked. That is so weird that it would not work from Powershell or Nuget Package Manager.

Thanks for the help guys.

You are welcome ;)

normal I like PowerShell but the VS integration is terrible...

I see that this issue is closed, but I had the same problem under different circumstances. I've managed to resolve it, so I am posting this comment in case someone else encounters the same problem.

In my case, I was using CMD.exe from the start and getting the same error message. Initially, I was running the "dotnet electronize start" command from the root of the solution folder. However, when I moved into the folder that contained the .csproj file that contained "ElectronNET.CLI" reference and ran the command again, it worked.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zlspjp picture zlspjp  路  5Comments

seanmars picture seanmars  路  5Comments

thnk2wn picture thnk2wn  路  4Comments

ernestotw85 picture ernestotw85  路  3Comments

philiphobgen picture philiphobgen  路  3Comments