Docker Community Forums

Share and learn in the Docker community.

Can't get dotnetcore web api that targets 4.6.1 framework to run on any windows container

docker

(Sbland64) #1

We have numerous .net core web API’s that we began building over a year ago when .net core was still in release candidate status. Because it was so new and lacking capabilities, we were compelled to continue referencing the 4.6.1 framework with the intent of eventually getting off it once .net core became more stable and feature rich. Although that day has come, we are unable to make the transition at this time, so we are still dependent on 4.6.1. We are finding that these APIs do not appear to work properly on any of the Microsoft base Docker images including aspnet, aspnetcore, dotnet, and iis. I am able to build the image and run the container without error, but when I attempt to access the API, I receive a 500 error. There are no errors in the docker log and I am not seeing any errors in the application STDOUT log. What makes these apps unique from a traditional asp.net API and .net core API is the process path. Below is an example from the published web.config.

<aspNetCore processPath=".\TestDotnetCore461WebAPI.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />

Any ideas how we can get these APIs running on Docker would be greatly appreciated.

thanks!

scott


(Doncicuto) #2

Hi Scott,
first my apologies as I’m not a dotnet developer and the following notes may not help you. If you want to have a docker container with 4.6.1 version at least to try if you can run your api I think you can try to create your own image using the Windows Server Core image from Microsoft.

This is how the dotnet-framework 4.6.2 image is created:

FROM microsoft/windowsservercore

RUN set COMPLUS_NGenProtectedProcess_FeatureEnabled=0 & \
    \Windows\Microsoft.NET\Framework64\v4.0.30319\ngen update & \
    \Windows\Microsoft.NET\Framework\v4.0.30319\ngen update

So you may try to replace that RUN sentence trying to download and execute the offline installer for 4.6.1.

I think this post contains valuable information to create your own image container.

Cheers!


(Sbland64) #3

Thank you, but there are already many Microsoft images with framework 4.6.n
installed. I’ve tried most of them without success.