Error: The ASP.NET compiler is only available on the .NET Framework version of MSBuild

Viewed 959

I'm new to Docker and when I'm trying to create a Docker image of an asp.net project and I am receiving this error:

Solution file error MSB4249: Unable to build website project "Application". The ASP.NET compiler is only available on the .NET Framework version of MSBuild.
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; dotnet restore' returned a non-zero code: 1

Here is my docker file:

    FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
    WORKDIR /app 
    #
    # copy vbproj and restore as distinct layers
    COPY *.sln .
    COPY Application/*.vbproj ./Application/
    #
    RUN dotnet restore 
    #
    # copy everything else and build app
    COPY . .
    COPY Application/. ./Application/

    #
    WORKDIR /app/ECDocker
    RUN dotnet publish -c Release -o out 
    #
    FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS runtime
    WORKDIR /app 
    #
    COPY --from=build /app/ECDocker/out ./
    ENTRYPOINT ["dotnet", "ECDocker.dll"]

I am running .net 4.6 and it's an asp.net webforms app. Any help is greatly appreciated

0 Answers
Related