Álvaro García
Álvaro García

Reputation: 19396

A published AOT worker service .NET 8 project doesn't work, but the compiled version works

I created a worker service in .NET 8. When I debug, it works. It also works if I run the compiled project, but if I run the published project, it doesn't work. I just see the console window for just a moment, and it finished.

I can't see anything in the log, because it stops working before the first log.

In the project file, in the .csproj, I see that by default, it publishes as OAT is enabled, false. If I disabled it, it works. So I guess the problem is related to this.

This is the main project that uses another projects. All of them are libraries (application and infrastructure layers). In this case, this parameter is not enabled. I don't know if I have to enable it in all the libraries that are used by the main project.

How could it be the problem? How could I use AOT?

Upvotes: 0

Views: 272

Answers (0)

Related Questions