Docker Community Forums

Share and learn in the Docker community.

.NET Framework: "Server Error in '/' Application" /AppName not Found 404


(Scriptsetsix) #1

Expected behavior

All folowing on Server2016 image on Azure
Container built on microsoft/aspnet/ image
application built on .net 4.0 copied to container
IIS applications built using powershell

go from host to container ip -> display Default.htm
go from host to container ip/AppName -> App start

Actual behavior

go from host to container ip -> display Default.htm OK
go from host to container ip/AppName -> "Server Error in ‘/’ Application"
go from host to container ip/AppName/default.aspx -> "Server Error in ‘/’ Application"
go from host to ip/AppName/Client/Default.htm (or any other location) same file as root -> 404


I’ve googled everywhere man …
and have 3 avenues to explore

  1. It’s a windows permission issue for folders
  2. I’ve got wrong .Net version in AppPool
  3. I’m using wrong image, start with microsoft/iis instead

Which is the likely to be the most productive avenue to investigate, or would others be better?

Steps to reproduce the behavior

See above

(Bktdev) #2

I’m seeing the same behavior running Docker on Win10. I’ve tried setting permissions on the web dir for Network Service, IIS_IUSRS, and Everyone! My default page is a .aspx, and our web app is based off of DotNetNuke. Constantly get a 404 when trying to hit our default page. Although I can execute a .htm file from the same directory! Weird…

Here is the full Dockerfile contents:

FROM microsoft/aspnet:4.6.2

RUN powershell c:\windows\system32\inetsrv\appcmd.exe set config \
-section:system.applicationHost/sites \
/“c:\logfiles” /commit:apphost

RUN powershell C:\Windows\System32\inetsrv\appcmd add apppool \
/ /managedRuntimeVersion:v4.0 \
/managedPipelineMode:Integrated \
/processModel.identityType:NetworkService \

RUN powershell New-Item -ItemType directory -Path C:\sites\intbase

RUN powershell New-Website -Name “intbase” -Port 80 -IPAddress “*” -HostHeader “intbase” -PhysicalPath “C:\sites\intbase” -ApplicationPool “intbase”

RUN powershell c:\windows\system32\dism /online /enable-feature /all /featurename:IIS-ApplicationDevelopment
RUN powershell Install-WindowsFeature -Name Web-Mgmt-Service
RUN powershell Install-WindowsFeature -Name Web-Windows-Auth
RUN powershell Install-WindowsFeature -Name NET-WCF-HTTP-Activation45
RUN powershell Install-WindowsFeature -Name NET-Framework-45-Core
RUN powershell Install-WindowsFeature -Name Web-AppInit
RUN powershell Install-WindowsFeature -Name Web-ASP
RUN powershell Install-WindowsFeature -Name Web-CGI
RUN powershell Install-WindowsFeature -Name Web-Includes
RUN powershell Install-WindowsFeature -Name Web-WebSockets
RUN powershell Install-WindowsFeature -Name Web-Request-Monitor
RUN powershell Install-WindowsFeature -Name WAS-Process-Model
RUN powershell Install-WindowsFeature -Name WAS-Config-APIs

RUN powershell New-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\WebManagement\Server -Name EnableRemoteManagement -Value 1 -Force
RUN powershell Start-Service -Name WMSVC
RUN powershell net user bktadmin Password1! /ADD
RUN powershell net localgroup administrators bktadmin /add

COPY intbase/ \sites\intbase


(Artisticcheese) #3

You enabled remote IIS management, so when you connect IIS manager to running container do you see your files in proper locations?

(Bktdev) #4

I do. All the files are in the root web directory, which is the same directory to which I applied permissions to the various users.

(Artisticcheese) #5

Well then issue is not with docker etc but with IIS and better suited to be answer in IIS related forum.