skip to Main Content

I have copied .NET framework from my local directory and build an image by using the below Dockerfile

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019

ADD setup C:setup

RUN cmd.exe /c start /wait C:setupNDP471DevPack.exe /q

RUN powershell -Command rm C:setup -r -Force

WORKDIR C:\Project
ENTRYPOINT ["C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe"]

Now I want verify that the .NET framework is whether installed or not in the image that was build?

2

Answers


  1. You can run dotnet --version to see if there’s a .NET runtime installed and which version it is. Something like this

    docker run --rm --entrypoint=dotnet <image name> --version
    
    Login or Signup to reply.
  2. You should be able to use:

    reg query "HKLMSOFTWAREMicrosoftNet Framework SetupNDP" /s
    

    In Visual Studio I can select my container and click "Open Terminal Window" and paste the above command.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search