Jumoo / uSync.CommandLine

Remote command line tools for Umbraco
5 stars 5 forks source link

Requirements? #5

Closed cvocvo closed 1 year ago

cvocvo commented 1 year ago

Is the .NET SDK or something else required to use this? (It installs and runs fine on my local dev PC but I have all sorts of runtimes and SDKs installed locally.

I have the .NET 6 runtimes installed:

PS C:\Users\Administrator\Downloads> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
PS C:\Users\Administrator\Downloads> dotnet tool install --global uSync.Cli
The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'tool' does not exist.
  * You intended to execute a .NET SDK command:
      No .NET SDKs were found.

Download a .NET SDK:
https://aka.ms/dotnet-download

Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found

I installed the latest .NET SDK and get a different error:

PS C:\Users\Administrator\Downloads> dotnet tool install --global uSync.Cli
C:\Users\Administrator\AppData\Local\Temp\5\c641b644-0293-4e14-9d7c-1453693444b4\restore.csproj : error NU1100: Unable
to resolve 'usync.cli (>= 0.0.0)' for 'net6.0'.
C:\Users\Administrator\AppData\Local\Temp\5\c641b644-0293-4e14-9d7c-1453693444b4\restore.csproj : error NU1100: Unable
to resolve 'usync.cli (>= 0.0.0)' for 'net6.0/any'.
The tool package could not be restored.
Tool 'usync.cli' 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 tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
PS C:\Users\Administrator\Downloads>

Any ideas?

PS C:\Users\Administrator\Downloads> dotnet --list-sdks
6.0.413 [C:\Program Files\dotnet\sdk]
PS C:\Users\Administrator\Downloads> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
PS C:\Users\Administrator\Downloads>
KevinJump commented 1 year ago

Hi,

It should run on .net 6 frameworks you have:

Just tired it (on a fairly clean machine)

 dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.21 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
dotnet tool install uSync.Cli --global
You can invoke the tool using the following command: uSync
Tool 'usync.cli' (version '10.0.4') was successfully installed.

maybe your default nuget sources are messed up ?

dotnet nuget list source
Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json
  2.  Microsoft Visual Studio Offline Packages [Enabled]
      C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\

check NuGet is enabled?

cvocvo commented 1 year ago

@KevinJump You're as fast at the wind -- I sincerely appreciate it.

That appears to be the issue:

PS C:\Users\Administrator\Downloads> dotnet nuget list source
No sources found.

How to fix:

PS C:\Users\Administrator\Downloads> dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org
Package source with Name: nuget.org added successfully.
PS C:\Users\Administrator\Downloads> dotnet nuget list source
Registered Sources:
  1.  nuget.org [Enabled]
      https://api.nuget.org/v3/index.json

Then the global install command works just fine; for reference this is on a Server 2019 install.