.NET Core Windows Desktop Apps

I’ve been looking at the new .NET Core Windows Desktop Apps feature in v5.4.0

I’ve followed through the mvc example and can get the app running as a desktop app, however I can’t app publish it. I get this error 'app.settings' does not exist

Is publishing only for Web Apps or is it possible to publish others NetCore apps?

(My end goal is an Angular app that is packaged as a Desktop App.)

You can only publish Web Apps not any .NET Core Apps.

For general .NET Core Apps the easiest way would be to have app tool installed and run it as normal, otherwise you can create a Custom .NET Core Desktop App which imports all the CEF Windows .dll’s and publishes it with the application.

1 Like

Thanks. Lots to understand with this feature :smile:

Are you saying that the sample “redis” app (from app list) cannot be published?

If I try “app publish-exe” I get an error

An exception occurred during a WebClient request

Another question. When you run an app, e.g. “cd redis && app” it closes the console window. Is that intended? Any way to stop that from happening?

All apps from app list are github.com/NetCoreWebApps which can be published.

The publish-exe command needs to download the 125MB .zip binaries from ServiceStack/WebWin so can take a while the first time, but it does work:

Yes it’s intended Desktop Apps don’t keep their console windows open, it can be disabled in your app.settings by adding:

CefConfig {HideConsoleWindow:false}

Thanks for the reply.

You should know that publishing doesn’t work for me as I get an error. You make it sound like it is downloading a dependency the first time, perhaps that isn’t working, as it fails immediately.

Also, running the app only seems to hide the console. So when the app is terminated the console process is still running in the background and has to be killed manually.

It doesn’t need any dependencies, it just needs to make some GitHub API calls then download https://github.com/ServiceStack/WebWin .zip’s tarball which I’m assuming you’re not able to download in your Environment.

You can run the /verbose flag to get more verbose logging:

$ app publish-exe /verbose
C:\Temp\redis>app publish-exe /verbose
args: ''
Command: publish-exe
Using 'C:\Temp\redis\app.settings'
API: https://api.github.com/repos/ServiceStack/WebWin
API: https://api.github.com/repos/ServiceStack/WebWin/releases
Using new release: C:\Users\cdm\.servicestack\cache\httpsapi.github.comreposServiceStackWebWinzipballv2
Downloading https://api.github.com/repos/ServiceStack/WebWin/zipball/v2
System.Net.WebException: An exception occurred during a WebClient request. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\cdm\.servicestack\cache\httpsapi.github.comreposServiceStackWebWinzipballv2'.
   at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
   at System.Net.WebClient.DownloadFile(Uri address, String fileName)
   --- End of inner exception stack trace ---
   at System.Net.WebClient.DownloadFile(Uri address, String fileName)
   at WebApp.Startup.CreateWebHost(String tool, String[] args, WebAppEvents events) in C:\src\dotnet-tools\dotnet-app\src\Web\Startup.cs:line 343
   at WebApp.Program.Main(String[] args) in C:\src\dotnet-tools\dotnet-app\src\WebApp\Program.cs:line 18

There is no “\users\cdm\.servicestack” directory. Is it being created?

Can you try again using the latest v0.0.12:

$ dotnet tool update -g app

Yes, that worked. Thanks.