I am using docker to build and run two services, one a .net core website and the other a .net core processor. I have the website up and running just fine. When I try to run my processor however, I get the following error message:
Could not execute because the specified command or file was not found. Possible reasons for this include:
You misspelled a built-in dotnet command.
You intended to execute a .NET Core program, but dotnet-chores.processor.dll does not exist.
You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
My dockerfile is as follows:
FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100 AS build COPY /src /all/src WORKDIR /all/src RUN dotnet build -c Release -o /app RUN dotnet publish --no-restore -c Release -o /app # FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 WORKDIR /app # COPY --from=build /app . EXPOSE 80 ENTRYPOINT ["dotnet", "chores.processor.dll"]
I have run the build and publish commands manually and they both run successfully; I have verified that the dll created by the publish command is indeed “chores.processor.dll”
My website, which is working, has an identical dockerfile except that “chores.processor.dll” is just “chores.dll”. I did notice that the csproj for my processor has some extra xml that my website does not. Processor csproj:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> <RootNamespace>Chores.Processor</RootNamespace> </PropertyGroup> <ItemGroup> <PackageReference Include="Dapper" Version="2.0.30" /> <PackageReference Include="MySqlConnector" Version="0.59.2" /> </ItemGroup> </Project>
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Dapper" Version="2.0.30" /> <PackageReference Include="MySqlConnector" Version="0.59.2" /> </ItemGroup> </Project>
It seems odd to me that the error message appears to be looking for dotnet-chores.processor.dll; why is it prefixed with “dotnet-”?
If anyone has any suggestions on what I can do to further debug this, I would appreciate it.