Open
Description
I have been trying to get mime maps working on this repository.
Every http request to unknown mime types (On IIS Express and Azure web apps) results in 404 error.
Steps.
- Clone/Download repo.
- Add an empty text file under wwwroot/assets. Rename it as sample.properties
- Add another empty file under same directory. Name it sample.json
- Request both files via browser. sample.json produces no error
- Requesting sample.properties produces 404 (
GET http://localhost:63554/assets/sample.properties 404 (Not Found))
What did I try.
- Added mime map on web.config of aspnet core project
- Added runAllManagedModulesForAllRequests to web.config
- Executed
appcmd set config /section:staticContent /+[fileExtension='properties',mimeType='application/octet-stream']
from IIS Express folder(C:\Program Files(x86)\IIS Express) in command line(as admin)
Here is full web.config
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false">
<environmentVariables />
</aspNetCore>
<staticContent>
<remove fileExtension=".properties" />
<mimeMap fileExtension=".properties" mimeType="application/octet-stream" />
<remove fileExtension=".txtabcd" />
<mimeMap fileExtension=".txtabcd" mimeType="application/text" />
</staticContent>
</system.webServer>
Interestingly enough, deploying this to an azure app service still produces this error.
@MarkPieszak Have you encountered a similar error on unusual mime types before?
PS: Default VS 2017 angular template works without adding mimemap for properties
file.
Metadata
Assignees
Labels
No labels