System.FormatException: Unrecognized argument format: 'hosting.ini'


I am having troubles running asp net application deployed from Visual Studio from to Ubuntu local virtual machine. All goes fine, but after deploy I cant start daemon process for an image (I can verify image is deployed).

Logs showing exception: System.FormatException: Unrecognized argument format: ‘hosting.ini’

Visual Studio console run command to deploy an image: Executing command [docker -H tcp:// run -t -d -p 80:8080 -e “server.urls=http://*:8080” webapp

Docker engine is accessible from host machine - I can reach and see all the images I have

A dockerfile generated by VS:

FROM microsoft/aspnet:1.0.0-beta7

ADD . /app

ENTRYPOINT ["./kestrel"]

What am I doing wrong? Please help!

My guess is that your ./kestrel entrypoint script is calling something incorrectly, and that something is what is outputting the exception: System.FormatException: Unrecognized argument format: 'hosting.ini' to your logs.

Check out the kestrel entrypoint script and see if you can tell what’s doing, and if you need to do anything else to get it to pass the right arguments over to whatever it’s calling.


There is a typo in the project.json file that I noticed:

    "kestrel": "Microsoft.AspNet.Hosting --serverMicrosoft.AspNet.Server.Kestrel --config hosting.ini"

should be
"kestrel": “Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.Kestrel --config hosting.ini”

If you change this you can deploy from VS to docker and the site will work as expected.


1 Like