"Cannot create a file" error when running Start-Website command in Powershell "Cannot create a file" error when running Start-Website command in Powershell powershell powershell

"Cannot create a file" error when running Start-Website command in Powershell


The error message:

Start-Website : Cannot create a file when that file already exists.

...usually means that you have a bindings conflict where there is already a site running on the same IP address, port and if you're using them, host header.

I'd check your new site bindings in IIS MMC then find out if something else is using exactly the same bindings.


Without any websites in the IIS configuration, the same error occurred. Reason were additional, old records at the end of applicationHost.config. None of these were visible in IIS Manager. After removing these XML records, the problem was solved.


Enable detailed error trace to find the reason. In my case, it was a mimeType element that duplicated a default one.