0

I am trying to run a Kestrel application targeting net461 on Docker, but it fails with no error message. It runs ok on Windows 10.

My Dockerfile is:

FROM microsoft/nanoserver
SHELL ["powershell"]
RUN new-item c:\MyAPI -itemtype directory
COPY .\\bin\\Debug\\net461\\win7-x64\\publish MyAPI  
EXPOSE 5000
# ENTRYPOINT ["C:\\MyAPI", "MyAPI.exe"]

After publishing I create the image:

docker build -t myapi .

and run it:

docker run -it --entrypoint powershell myapi

Then when I start the application manually within the container it stops with no error:

> cd MyAPI
> .\MyAPI.exe
> $lastExitCode
-1073741515

That error code (0xC0000135 or STATUS_DLL_NOT_FOUND) seems to indicate there's a DLL missing---but how do I figure out what it is on nanoserver if there's no error message?

The output of [System.Environment]::OSVersion is Win32NT 10.0.14393.0.

The dependencies from the project are:

"dependencies": {
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0",
    "Microsoft.AspNetCore.Cors": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.1",
    "Microsoft.AspNetCore.Mvc.Core": "1.1.1",
    "Microsoft.AspNetCore.Owin": "1.1.0",
    "Microsoft.IdentityModel.Tokens": "5.1.2",
    "Microsoft.AspNetCore.Authentication.JwtBearer": "1.1.0",
    "Microsoft.AspNet.SignalR": "2.2.1",
    "Akka": "1.1.3",
    "Akka.Remote": "1.1.3"
},

"frameworks": {
    "net461": {
    }
}, 

1 Answer 1

0

Nano server does not support the Full .NET framework, you can only run netstandard apps, so this will not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.