NetSparkleUpdater / NetSparkle

NetSparkle is a C#, cross-platform, highly-configurable software update framework with pre-built UI for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 signatures. View basic usage here in the README and try the samples for yourself.
https://netsparkleupdater.github.io/NetSparkle/
MIT License
609 stars 84 forks source link

AppCastGenerator - cannot generate keys #104

Closed miroelk closed 4 years ago

miroelk commented 4 years ago

Hi, I'm using latest preview as of writing this and I'm not able to generate keys.

I have tried adding Nuget to my project (using .NET Core 3.1), but I got an error:

Package 'NetSparkleUpdater.Tools 2.0.0-preview20200614001' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

The Nuget is not yet compatible with .NET Core 3.1, no problem, so I cloned the repo (develop branch) and built project NetSparkle.Tools.AppCastGenerator and it was built sucessfully. Afterwards I opened cmd and ran command generate_appcast.exe --generate-keys and got error:

Cannot use stream for resource [C:\Repos\NetSparkle\src\NetSparkle.Tools.AppCastGenerator\obj\Release\netcoreapp3.0\generate_appcast.deps.json]: No such file or directory
A fatal error was encountered. The library 'hostpolicy.dll' required to execute the application was not found in 'C:\Program Files\dotnet'.
Failed to run as a self-contained app.
  - The application was run as a self-contained app because 'C:\Repos\NetSparkle\src\NetSparkle.Tools.AppCastGenerator\obj\Release\netcoreapp3.0\generate_appcast.runtimeconfig.json' was not found.
  - If this should be a framework-dependent app, add the 'C:\Repos\NetSparkle\src\NetSparkle.Tools.AppCastGenerator\obj\Release\netcoreapp3.0\generate_appcast.runtimeconfig.json' file and specify the appropriate framework.

Could you please advise, how should this be properly used? Maybe I'm just using it wrong...

Deadpikle commented 4 years ago

Hmmm, it seems like there are two problems:

  1. Adding the tools via NuGet should work -- the tools both target netcoreapp3.0, but clearly something thought it was for .NET Framework. Hm.
  2. The tools aren't distributed as self-contained apps (they probably should be).

Could you try installing the .NET Core Runtime (https://dotnet.microsoft.com/download/dotnet-core/3.1 -- see the Desktop Runtime 3.1.5 section) and seeing if that helps, here?

miroelk commented 4 years ago

After I reinstalled Desktop Runtime, it started working.

The interesting point here is that even though I had already installed .NET Core SDK and when I listed runtimes, Desktop Runtime was there. But it wasn't installed correctly, probably because of the missing dll, but after reinstalling it, just the Desktop Runtime, it was fixed and is working now.

Deadpikle commented 4 years ago

Thanks again for this report. I've done a few things here:

  1. Updated the readme in this repo to make it more obvious that you need the desktop runtime installed
  2. Added a readme.txt to the tools NuGet to tell people to use the desktop runtime removed this as it was messing with the publishing process; might fix later
  3. Don't publish tools trimmed (in case this was the real cause...)
  4. Updated tools to use .NET Core 3.1

I ran a test, and from a new .NET Core 3.1 project, I could successfully reference the NetSparkle tools preview with no issues.

Restoring packages for C:\Users\name\source\repos\WPFTesting\WPFCoreTesting\WPFCoreTesting.csproj...
  GET https://ci.appveyor.com/nuget/mahapps.metro/FindPackagesById()?id='NetSparkleUpdater.Tools'&semVerLevel=2.0.0
  GET https://api.nuget.org/v3-flatcontainer/netsparkleupdater.tools/index.json
  OK https://api.nuget.org/v3-flatcontainer/netsparkleupdater.tools/index.json 91ms
  GET https://api.nuget.org/v3-flatcontainer/netsparkleupdater.tools/2.0.0-preview20200618001/netsparkleupdater.tools.2.0.0-preview20200618001.nupkg
  OK https://ci.appveyor.com/nuget/mahapps.metro/FindPackagesById()?id='NetSparkleUpdater.Tools'&semVerLevel=2.0.0 354ms
  OK https://api.nuget.org/v3-flatcontainer/netsparkleupdater.tools/2.0.0-preview20200618001/netsparkleupdater.tools.2.0.0-preview20200618001.nupkg 121ms
Installing NetSparkleUpdater.Tools 2.0.0-preview20200618001.
Installing NuGet package NetSparkleUpdater.Tools 2.0.0-preview20200618001.
Committing restore...
Generating MSBuild file C:\Users\name\source\repos\WPFTesting\WPFCoreTesting\obj\WPFCoreTesting.csproj.nuget.g.props.
Writing assets file to disk. Path: C:\Users\name\source\repos\WPFTesting\WPFCoreTesting\obj\project.assets.json
Successfully installed 'NetSparkleUpdater.Tools 2.0.0-preview20200618001' to WPFCoreTesting
Executing nuget actions took 1.6 sec
Time Elapsed: 00:00:14.5894319
========== Finished ==========

Thanks!