Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assembly specified in the dependencies manifest was not found while running docker with dotnet-core project

I have message error like this:

Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.aspnetcore.antiforgery', version: '1.1.1', path: 'lib/netstandard1.3/Microsoft.AspNetCore.Antiforgery.dll'

And its happening when I run this commands:

dotnet build -o obj/Docker/publish -c Release
dotnet publish -o obj/Docker/publish -c Release
docker build -t webapi .
docker run -p 80:80 --name api webapi

But in project, I can see reference

<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="1.1.1" />

And in my Dockerfile I think I put all necessary information:

FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "WebApi.dll"]

Have you any idea what can be a problem for this situation?

UPDATE: After dotnet restore communicate change into:

Error: assembly specified in the dependencies manifest was not found -- package: 'microsoft.extensions.dependencyinjection.abstractions', version: '1.1.0', path: 'lib/netstandard1.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll'

And its still this same situation. But now after restore its don't change anymore.

like image 710
mkubasz Avatar asked Mar 20 '17 14:03

mkubasz


1 Answers

To fix this error I have to changed my WORKDIR. It was reported in GitHub

WORKDIR /app
like image 70
mkubasz Avatar answered Nov 15 '22 04:11

mkubasz