System can not find path specfied

Shyam Kumar 846 Reputation points
2025-06-03T08:04:35.28+00:00

Visual Studio installation completed successfully.

Cleaning up...

Removed installer file.

Cleanup completed.

Visual Studio 2022 installation process finished.

re-exec error: exit status 1: output: hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3)

I am seeing above error when buliding the docker image in pipeline

Azure DevOps
0 comments No comments
{count} votes

8 answers

Sort by: Most helpful
  1. Durga Reshma Malthi 4,530 Reputation points Microsoft External Staff Moderator
    2025-06-03T09:06:00.7633333+00:00

    Hi Diptesh Kumar

    Could you please try the below steps to resolve this issue:

    1. Try removing unused Docker data and resetting the environment, this clears unused images, containers, and layers that might be causing conflicts.
         docker system prune -a
      
    2. Restart Docker Desktop or the Docker service (Restart-Service docker) in PowerShell.
    3. Ensure your host machine or build agent is running Windows Server 2022 or compatible. As per the text file you are using 2019 User's image Replace it with FROM mcr.microsoft.com/windows/servercore:ltsc2022
    4. Based on the text file you shared, you’re still copying and executing the install_vs_2019.ps1 script, even though you mentioned removing it. User's image
    5. Once updated, rebuild with no cache to avoid using any corrupted intermediate layers:
         docker build --no-cache -t your-image-name
      
    6. If you're using Windows containers, ensure Docker is running in Windows mode: Open Docker Desktop -> Settings -> Switch to Windows Containers.

    Hope this helps!

    Please Let me know if you have any queries.


  2. Durga Reshma Malthi 4,530 Reputation points Microsoft External Staff Moderator
    2025-06-04T07:57:14.8066667+00:00

    Hi Diptesh Kumar

    As we discussed in private message,

    Based on the error, it looks like the .NET Framework 4.5.2 reference assemblies are missing, which could be causing the validation failure.

    The output 461814 indicates that .NET Framework 4.7.2 is installed, not 4.5.2.

    User's image

    The command Test-Path "C:\Program Files(x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2" returning False indicates that the reference assemblies for .NET Framework 4.5.2 are not present in the expected directory.

    You need to install .NET Framework 4.5.2 explicitly. Open the Visual Studio Installer -> Go to Individual Components -> Search for .NET Framework 4.5.2 Targeting Pack and install it.

    You can also install it by defining in the docker file:

    # Install .NET Framework 4.5.2
    RUN powershell -Command \
        Invoke-WebRequest -Uri "https://download.microsoft.com/download/1/0/5/105B5B3D-1B5D-4B5D-8B3D-1B5D4B5D4B5D/NDP452-KB2901957-x86-x64.exe" -OutFile "dotNetFx452.exe"; \
        Start-Process -FilePath "dotNetFx452.exe" -ArgumentList "/q /norestart" -NoNewWindow -Wait; \
        Remove-Item -Force "dotNetFx452.exe"
    

    After adding the installation command, rebuild your Docker image and validate the installation again using the same PowerShell commands you used previously.

    Additional References:

    https://learn.microsoft.com/en-us/dotnet/framework/install/how-to-determine-which-versions-are-installed

    https://stackoverflow.com/questions/27931925/targeting-pack-for-net-4-5-2-not-installed

    Hope this helps!

    Please Let me know if you have any queries.

    If you found the information helpful, please click "Upvote" on the post to let us know and consider accepting the answer as the token of appreciation. Thank You.

    0 comments No comments

  3. Durga Reshma Malthi 4,530 Reputation points Microsoft External Staff Moderator
    2025-06-04T10:28:07.77+00:00

    Hi Diptesh Kumar

    As we discussed in private message,

    Firstly, in this docker file

    User's image

    Update this to --add Microsoft.Net.ComponentGroup.TargetingPacks.4.5.2 `

    Once updated, rebuild the image and verify with

    Test-Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2"
    

    This should return True:

    If this does not work, then you should execute the below command inside the container to install .NET Framework 4.5.2 properly, Add this command at 70th line

    User's image

    # Install .NET Framework 4.5.2
    RUN powershell -Command `
        Invoke-WebRequest -Uri "https://download.microsoft.com/download/1/0/5/105B5B3D-1B5D-4B5D-8B3D-1B5D4B5D4B5D/NDP452-KB2901957-x86-x64.exe" -OutFile "dotNetFx452.exe"; `
        Start-Process -FilePath "dotNetFx452.exe" -ArgumentList "/q /norestart" -NoNewWindow -Wait; `
        Remove-Item -Force "dotNetFx452.exe"
    

    Then Rebuild the Docker Image after updating your Dockerfile with

    docker build -t your-image-name
    

    and verify it again with

    Test-Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2"
    

    Hope this helps!

    Please Let me know if you have any queries.

    If you found the information helpful, please click "Upvote" on the post to let us know and consider accepting the answer as the token of appreciation. Thank You.

    0 comments No comments

  4. Durga Reshma Malthi 4,530 Reputation points Microsoft External Staff Moderator
    2025-06-04T15:33:32.9966667+00:00

    Hi Diptesh Kumar

    As we discussed in private message, use the below command

    RUN powershell -Command `
        Invoke-WebRequest -Uri "https://download.microsoft.com/download/1/0/5/105B5B3D-1B5D-4B5D-8B3D-1B5D4B5D4B5D/NDP452-KB2901957-x86-x64.exe" -OutFile "C:\\dotNetFx452.exe"; `
        Start-Process -FilePath "C:\\dotNetFx452.exe" -ArgumentList "/quiet" -NoNewWindow -Wait; `
        Remove-Item -Force "C:\\dotNetFx452.exe"
    
    0 comments No comments

  5. Durga Reshma Malthi 4,530 Reputation points Microsoft External Staff Moderator
    2025-06-05T08:14:18.2933333+00:00

    Hi Diptesh Kumar

    As we discussed in private message, I suspect that the above Uri no longer exists and NDP452-KB2901957-x86-x64.exe is the runtime, not the developer pack.

    Could you please try the below commands in the docker file

    # Install .NET Framework 4.5.2 Developer Pack (targeting pack for build support)
    ADD https://download.microsoft.com/download/5/2/6/5260AC9F-6F9A-4EDE-9D19-A54BCB5E11E3/NDP452-DevPack-KB2901951-ENU.exe C:\ndp452.exe
    RUN powershell -Command "Start-Process -FilePath 'C:\\ndp452.exe' -ArgumentList '/quiet /norestart' -Wait; Remove-Item -Force 'C:\\ndp452.exe'"
    

    Once the image is built, check inside the container with this command:

    Test-Path "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2"
    

    If the above command in the Docker file does not work, please try the command below.

    # Install .NET Framework 4.5.2 Developer Pack (for build targeting)
    ADD https://download.microsoft.com/download/5/2/6/5260AC9F-6F9A-4EDE-9D19-A54BCB5E11E3/NDP452-DevPack-KB2901951-ENU.exe C:\ndp452.exe
    RUN C:\ndp452.exe /quiet /norestart /log C:\ndp452.log && del C:\ndp452.exe
    

    Again, rebuild the image, run Test-Path inside the container to verify.

    Hope this helps!

    Please Let me know if you have any queries.


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.