title: dotnet core aspnet 2.2 image works on windows containers but not linux
body: <p>I have a project built using .net 2.2. Here is the dockerfile from one of the services:</p>
  <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS base
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS publish
  WORKDIR /src
  COPY Identity.Api.csproj .
  RUN dotnet restore MyApp.Api.csproj
  COPY . .
  RUN dotnet publish &quot;MyApp.Api.csproj&quot; -c Release -o /app
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;MyApp.Api.dll&quot;]
  </code></pre>
  <p>For my colleagues, they can pull this project and docker build using this dockerfile when running Docker Desktop using Linux Containers. But for me, for some weird reason, when I try to docker build, I get the following error</p>
  <pre><code>Step 8/14 : RUN dotnet restore MyApp.Api.csproj
   ---&gt; Running in 99df436556bb
  /usr/share/dotnet/sdk/2.2.207/NuGet.targets(119,5): error : An error occurred while retrieving package metadata for 'System.Memory.4.5.1' from source '/usr/share/dotnet/sdk/NuGetFallbackFolder'. [/src/MyApp.Api.csproj]
  /usr/share/dotnet/sdk/2.2.207/NuGet.targets(119,5): error :   Root element is missing. [/src/MyApp.Api.csproj]
  The command '/bin/sh -c dotnet restore MyApp.Api.csproj' returned a non-zero code: 1
  </code></pre>
  <p>Here is my dotnet --info</p>
  <pre><code>.NET SDK (reflecting any global.json):
   Version:   5.0.102
   Commit:    71365b4d42
  
  Runtime Environment:
   OS Name:     Windows
   OS Version:  10.0.19042
   OS Platform: Windows
   RID:         win10-x64
   Base Path:   C:\Program Files\dotnet\sdk\5.0.102\
  
  Host (useful for support):
    Version: 5.0.2
    Commit:  cb5f173b96
  
  .NET SDKs installed:
    2.1.400 [C:\Program Files\dotnet\sdk]
    2.1.520 [C:\Program Files\dotnet\sdk]
    2.2.107 [C:\Program Files\dotnet\sdk]
    5.0.101 [C:\Program Files\dotnet\sdk]
    5.0.102 [C:\Program Files\dotnet\sdk]
  
  .NET runtimes installed:
    Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.24 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 5.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  </code></pre>
  <p>However, if I switch to Windows Containers, I can get this project to docker build.</p>
  <p>I can't figure out what is unique about my environment.</p>
  <p>I have Docker Container running WSL2.</p>
  <pre><code>PS c:\&gt; wsl -l -v
    NAME                   STATE           VERSION
  * docker-desktop-data    Stopped         2
    docker-desktop         Stopped         2
  </code></pre>
  <p>Any help appreciated.</p>