I have a .NET Core project that contained 2 projects:
SLN:
- Web-API
- Infrastructure
I was building it with docker using this dockerfile
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
COPY . ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
# Build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /app
COPY --from=build-env /app/ .
ENTRYPOINT ["dotnet", "/app/Lab/out/API.dll"]
But now I have created a Web application as well in my solution
SLN:
- Web-API
- Web-App
- Infrastructure
Suddenly, docker isn't building anymore. How come? How can I create two docker containers based on the same solution one for the Web-API and one for the Web-app?
Error message from Docker:
The "GetDotNetHost" task could not be loaded from the assembly /usr/share/dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.razor.viewcompilation/2.0.3/build/netstandard2.0/Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tasks.dll. Assembly with same name is already loaded Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [/app/Lab/API.csproj]
RUN dotnet publish -c Release -o out, just for sake of finding the issue, you can comment this line and try again