'Unable to automatically deploy a dotnet app to Elastic Beanstalk

I’m trying to deploy a test application to EB. I’m running into an issue. I followed this tutorial: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/dotnet-linux-core-tutorial.html

When I upload the test application, it fails to start. /var/log/eb-engine.log says

2022/02/07 21:59:18.585543 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]. Stop running the command. Error: err or stat /var/app/staging/dotnet-core-tutorial: no such file or directory with file /var/app/staging/dotnet-core-tutorial

So I changed the parent directory in my source bundle so that it exported into /var/app/staging/dotnet-core-tutorial instead of /var/app/staging. Now I get this error

2022/02/07 22:29:51.468918 [ERROR] An error occurred during execution of command [app-deploy] - [CheckProcfileForDotNetCoreApplication]. Stop running the command. Error: the re is no .runtimeconfig.json file for your single application. Please provide a valid application

I confirmed that the source bundle does have a .runtimeconfig.json file.



Solution 1:[1]

The .runtimeconfig.json file is generated when you run the dotnet publish -o site command, so check if this command is running properly for you.

If you take a look on the tutorial, section "To create a source bundle" you have this file, so check the steps that you already did.

Also if you want to force this file to be generated you can add set <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> directly, but this is normally needed when you are not creating executable files like class libraries.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1