0

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?

Kevek
  • 2,534
  • 5
  • 18
  • 29
  • 1
    The solution you've shown can be used. instead of only using the path of your dll, use rather the path of dotnet (usually `c:\Program Files\dotnet\dotnet.exe`, but use environment variable to get that path) along with the path of your dll. ` run ` – Cid Apr 26 '20 at 17:39
  • @Cid - That sounds very promising and I've given a few variations a shot. Unfortunately `dotnet run` doesn't seem right as that doesn't even work from the command line. If I do `dotnet ` it does work on the command line, but whether the path is included or not for dotnet in the registry key it doesn't seem to do anything. I haven't found anything useful about why it didn't work in the EventViewer either. I need to generate all of the permutations I can think of and try all of them before I give up, but it didn't work as seamlessly as I'd hoped! – Kevek May 04 '20 at 00:46

0 Answers0