From docker container error: An assembly specified in the application dependencies manifest (....deps.json) was not found: package: 'Autofac.Extensions.DependencyInjection', version: '4.2.0' path: 'lib/netstandard1.1/Autofac.Extensions.DependencyInjection.dll'
My local machine Ubuntu 16.04 Asp.net core 2.0.5
I run docker container and get error:
An assembly specified in the application dependencies manifest (ProjectMe.deps.json) was not found:
package: 'Autofac.Extensions.DependencyInjection', version: '4.2.0'
path: 'lib/netstandard1.1/Autofac.Extensions.DependencyInjection.dll
Dockerfile:
FROM microsoft/aspnetcore-build:2.0
WORKDIR /app
ENV ASPNETCORE_URLS http://*:8100
ENV ASPNETCORE_ENVIRONMENT docker
COPY ./bin/Release/netcoreapp2.0 .
ENTRYPOINT ["dotnet", "ProjectMe.Api.dll"]
ProjectMe.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\netcoreapp2.0\ProjectMe.Api.xml</DocumentationFile>
<OutputPath>bin\Debug\netcoreapp2.0\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Folder Include="wwwroot\Files\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.5" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.4" />
<PackageReference Include="RawRabbit" Version="2.0.0-beta8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="3.0.0" />
<PackageReference Include="ClosedXML" Version="0.93.1" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ProjectMe.Common\ProjectMe.Common.csproj" />
</ItemGroup>
</Project>
COPY ./bin/Release/netcoreapp2.0 .
You need to dotnet publish the app and copy it over from publish directory.
yes, before i publish project on local machine with command:
dotnet publish "ProjectMe.Api.csproj" -c Release
or do you mean publish inside docker image and than copy?
Good example here based on WORKDIR
https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile
@dborovsky let me know if you have any further questions.
@jeffschwMSFT thanks. I didn`t find solution and just a bit change dockerfile. Now all good.