Skip to content

How to start service with a .Net Core 3.0 single file exe #129

@nologinatgit

Description

@nologinatgit

I have created an ASP.NET Core 3.0 project and start it as a Windows service with your library. When I choose the conventional publishing in the Windows service project, it creates nearly 500 files and it can be started with this library and it serves the requests using the proper URLs.

However, when I choose the single exe as the publishing form, I get 1 file that is 175+ MB in size:

    <LangVersion>latest</LangVersion>
    <PublishReadyToRun>false</PublishReadyToRun>
    <PublishSingleFile>true</PublishSingleFile>
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>

When I simply start it, I can see the following:

Starting up as a console service host
The ... service is now running, press Control+C to exit.

Unfortunately, I can't see any OnStart, OnStop or OnError message in the log file.

Can I somehow use the single exe format and run it as a service?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions