Start .NET Core Desktop Application at Windows Login

  asp.net-core-3.1, c++, windows

I recently ported a .NET Framework WPF desktop application to .NET Core 3.1.

Everything went great, with one exception. My app can optionally be set to startup when logging in to windows.

This used to work perfectly fine in the .NET Framework world by using the strategy detailed in this StackOverflow answer.

However, the .NET Core version shows the following at login:

enter image description here

This makes sense I suppose, considering that a .NET Core application is just a dll being run by dotnet run but it’s still unfortunate. I’ve tried publishing my .NET Core version as self-contained as well as a single .exe, but I get the same results.

Manually running the app (regardless of how it was published) as soon as I’ve logged works as expected and is fine, but I’d really rather it be automatic if that setting is chosen. I haven’t explored simply using a script at login to call dotnet run <my app> yet, though that will be my next attempt unless I’m able to find a more elegant solution. I’d really rather preserve the functionality I had in the .NET Framework world, so, has anyone encountered this and found a reasonable solution?

Source: StackOverflow

LEAVE A COMMENT