The assembly specified in the application dependency manifest was not found:

I developed the application in asp.net-core 2.0 preview1. I developed for Windows with Visual Studio 2017.

Now I want to deploy it to a Linux server using Docker.

I created a Docker file:

FROM microsoft/aspnetcore:2.0 ARG source WORKDIR /app EXPOSE 44305 COPY ${source:-obj/Docker/publish} . ENTRYPOINT ["dotnet", "Aplication.dll"] 

After executing the following commands:

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

Afer last run command. I get the following error:

 An assembly specified in the application dependencies manifest (Aplication.deps.json) was not found: package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.0-preview1-final' path: 'lib/netcoreapp2.0/Microsoft.AspNetCore.Antiforgery.dll' This assembly was expected to be in the local runtime store as the application was published using the following target manifest files: manifest.win7-x64.xml;manifest.win7-x86.xml;manifest.osx-x64.xml;manifest.linux-x64.xml 

I am new to asp.net-core and especially with Docker. So any help with this is wonderful.

+7
c # docker dockerfile asp.net-core
source share
2 answers

You need to specify the -r linux-x64 parameter in the dotnet publish command:

 dotnet publish -o obj/Docker/publish -c Release -r linux-x64 

This will make standalone deployment.

+4
source share

Try using this image "2.0.0-preview1". Basically change the first line to FROM microsoft / aspnetcore: 2.0.0-preview1 if your local has a preview of 1 dotnet core.

If it doesn't work, check your local version of the dotnet kernel, it points to 2.0.0-preview2-final, and then change all your links pointing to 2.0.0-preview2-final in the csproj file, then use 2.0. 0-preview2 image. Hope this helps you.

+2
source share

All Articles