Dave's Blog

IIS 404 when file exists


January 14, 2021

I had created a IIS site using slashes as directory separator

New-WebSite -Name TestUi -Port 11231  -PhysicalPath "$hostingDirPath/publishUi/publish" -ApplicationPool Ui -force

which gave me

iis 404 when file exists

New-WebSite -Name TestUi -Port 11231  -PhysicalPath "$hostingDirPath\publishUi\publish" -ApplicationPool Ui -force

fixes it (changing slashes to backslashes). Who'd have thought?