- Home /
Why does my WebGl game run in the browser from OS but I get 404 errors when I run from IIS in my ASP.NET core 2.0 app?
I am trying to add my game to my secure ASP.NET core 2.0 site, all requests are rerouted to https. When I launch the game build in my browser from the local index.html it runs fine. When I run through IIS each of the runtime files all get 404 errors. Here is the list of files that get the 404 (Not Found) error:
build.asm.code.unityweb build.asm.framework.unityweb build.asm.memory.unityweb build.data.unityweb
Any assistance with this would be greatly appreciated.
Thanks in advance.
I realized I should have noted that the index.html launches fine so I do not believe it is a routing issue.
After a ton of research it seems that my web.config is either wrong or being ignored. When I change .unityweb to .jpeg and modify the .json accordingly the game runs great. $$anonymous$$y web.config contains:
<staticContent>
<remove fileExtension=".unityweb" />
<mime$$anonymous$$ap fileExtension=".unityweb" mimeType="application/octet-stream" />
</staticContent>
<handlers>
<remove name="aspNetCore"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCore$$anonymous$$odule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
You are right! When I saw this solution, I just pass by as this $$anonymous$$AY NOT BE THE PROPER WAY TO DO IT. But I'm trying hard to find out any other solution to solve the 404 error. But none. When I try to download the file for the extension *.unityweb, but I got error which mean the file isn't there. So I suspect this maybe happened on ASP.NET CORE 2.0, or IIS 10 (my server is WinServer 2016). Hopefully someone realize this problem or point out I'm wrong.
Answer by drorriov · Jun 28, 2018 at 10:36 AM
Like spokrock said, you need to define MIME type. In IIS at your website you need to go to MIME TYPES and add File name extnestion of:
.unityweb
MIME type:
application/octet-stream