Hello , i am trying to deploy my asp net website on heroku using docker .. but i really need help as i keep getting error ... i keep getting error while building
(dotnet build -t test . or dotnet build .) this command give me the below error .
i was following the steps in this link Click Here

error.PNG

i have tried to change to used the windows container and now i get this error

error2.PNG

  • i looked for solutions and i found that i have to change in csproj and i have chnaged in it as below

csproj.png

  • another solution was to use (dotnet build) i have used that and i got the error below

error3.PNG

PLease note that my docker file now contains as following

`# Dockerfile

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app

COPY *.csproj ./
RUN dotnet restore

COPY . .
RUN dotnet publish -c Release -o out

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .

ENTRYPOINT [ "dotnet", "test.dll" ]`

  • i also have another question in docker file the WORKDIR what should come after it is it the directory that has my project or what ??????????????????????

i hope someone can help me pleaseeee

thank you

I don't see why this should work at all given the error output. You need to resolve the errors given such as "CodeTaskFactory."

YOU get to fix that and the other errors. Sometimes folk think this is a simple fix, sometimes it is but right there in the error is why.

Let me ask why do this at all? If you want to run a website there are much easier ways to put together a site.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.