Reputation: 9619
I'm trying to get my ASP.NET site in a Windows Container (it cannot be moved to .NET Core just yet). When I just copied my app into inetpub\wwwroot I got an error 500. I even tried setting detailed errors and everything in the web.config file but I still got the "same" error.
I tried removing files and commenting out my web.config until it began working again with no luck what so ever.
So I realized that even with an empty web.config the site fails. Right now I have a single default.html file which prints "Hello World!", everything works until I add an empty web.config in that directory.
This is driving me nuts!
1) Is there a way to see the real error or a better description of what's going on inside the container? I've tried with the Event Viewer (Get-EventLog) and the logs of the IIS with no luck.
2) What the heck is going on? Is this even related to my issue? Maybe a site with an empty web.config always fails :(
EDIT: My Dockerfile is irrelevant since I'm just firing up a container of the microsoft/aspnet:4.6.2 image.
docker run -d -p 8888:80 microsoft/aspnet:4.6.2
Once the container starts I get in with:
docker exec -it mycontainer powershell
Once inside I created the default.html file as follows:
echo "Hello World!" > default.html
If I then go to http://localhost:8888/default.html I see the right Hello World message. After that, I create a dummy web.config with the following:
echo "" > web.config
And when I refresh the default.html file I get the 500 error :(
Upvotes: 1
Views: 804
Reputation: 3832
Web.config shall contain configuration
element. Issue is not docker specific. https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/configuration-element
Upvotes: 1