My solution is not building when I use docker image mcr.microsoft.com/dotnet/sdk:5.0

romnicksagala 1 Reputation point
2021-04-19T10:46:28.847+00:00

Here is the error message:

5.0: Pulling from dotnet/sdk
Digest: sha256:85ea9832ae26c70618418cf7c699186776ad066d88770fd6fd1edea9b260379a
Status: Downloaded newer image for mcr.microsoft.com/dotnet/sdk:5.0

  • dotnet build LEAD/Scheduler/Scheduler.csproj
    Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET
    Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
Nothing to do. None of the projects specified contain packages to restore.
/drone/src/LEAD/Scheduler/Scheduler.csproj(1199,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/5.0.202/Microsoft/VisualStudio/v16.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/5.0.202/Microsoft/VisualStudio/v16.0/WebApplications/Microsoft.WebApplication.targets" is correct, and that the file exists on disk.

Build FAILED.

/drone/src/LEAD/Scheduler/Scheduler.csproj(1199,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/5.0.202/Microsoft/VisualStudio/v16.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "/usr/share/dotnet/sdk/5.0.202/Microsoft/VisualStudio/v16.0/WebApplications/Microsoft.WebApplication.targets" is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)

and the framework version is

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>

also. we try other images but they are not working

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,103 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yogi 351 Reputation points
    2021-06-12T06:05:20.343+00:00

    When you create your solution in Visual Studio make sure to check the option that says – Place solution and project in the same directory.
    Please refer - ASP.NET Core App in a Docker Container

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.