I'm trying to update an ASP.NET Core 2.0 application that runs in Docker to .NET Core 2.1 RC1.
Here's my simplified .csproj
file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Version>$(Version)</Version>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.1.0-preview1-final" />
</ItemGroup>
</Project>
And here's the Dockerfile
:
FROM microsoft/dotnet:2.1-sdk-alpine AS builder
WORKDIR /
COPY . .
RUN dotnet restore My.Project/My.Project.csproj
RUN dotnet publish My.Project/My.Project.csproj -o /dockerout/ -c Release
FROM microsoft/dotnet:2.1-aspnetcore-runtime-alpine
WORKDIR /app
EXPOSE 80 5000
COPY --from=builder /dockerout .
ENTRYPOINT ["dotnet", "My.Project.dll"]
I can build the image in Docker but running it fails with
It was not possible to find any compatible framework version The specified framework 'Microsoft.AspNetCore.All', version '2.1.0-rc1-final' was not found.
- Check application dependencies and target a framework version installed at: /usr/share/dotnet/
- Installing .NET Core prerequisites might help resolve this problem: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
- The .NET Core framework and SDK can be installed from: https://aka.ms/dotnet-download
Is there something I'm missing? Or should I just wait for the final release of Core 2.1?
dotnet version
inside your docker container, to see what exact version you have available there? – Riscie2.1.300-rc1-008673
. In the second phase it prints an error "Did you mean to run dotnet SDK commands? Please install dotnet SDK from: go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409". – Kirill Rakhman