question

PavelVinnikov-6712 avatar image
0 Votes"
PavelVinnikov-6712 asked LimitlessTechnology-2700 answered

IIS v6.2 for Windows Server 2012 & WebAssembly modules

Hello,

I'm trying to load some SDK module within my page. The SDK requires another .wasm module, which couldn't be loaded. It loads just fine locally, but when it comes to stage I'm getting this error:
189703-image.png



It looks like IIS can't serve WebAssembly modules, but I did add that 'application/wasm' type to MIME types in IIS config what should make it work and it doesn't happen. I've compared both (local and stage) environments and their confings are the same. The only difference is that locally I'm using IIS for Windows 10 and on stage it's IIS for Windows Server 2012.

Can you confirm if IIS for Windows Server 2012 is able to serve .wasm files?

windows-server-iiswindows-server-2012
image.png (5.3 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PavelVinnikov-6712 ,

IIS cannot serve .wasm files by default, but it can be achieved by add application/wasm to MIME types. Did the url of .wasm file is right? What I mean is whether you can see mcclubone folder and click into _AFTF, Inc, PSPDFKit, pspdfkit folders to see that .wasm file through url https://sandbox.clubwise.com if enable directory browsing? And could you please check IIS log to find this record and get error status code, sub status code of it? Status code can show the reason of this error.

0 Votes 0 ·
PavelVinnikov-6712 avatar image
0 Votes"
PavelVinnikov-6712 answered

Hi @BruceZhang-MSFT

Thanks for your input.

As I wrote I added 'application/wasm' type to MIME types in IIS config, but it didn't work. But as you suggested I checked folders and bingo - this has been solved. The reason was is that due to the fact that we have a complex network hierarchy and structure, the folder was copied incorrectly, hence IIS couldn't find the file that was being requested.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PavelVinnikov-6712 ,

I'm glad your issue was resolved.

0 Votes 0 ·
LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hi @PavelVinnikov-6712

Yes, IIS for Windows Server 2012 is a capable static file server for Blazor apps. You Need A Web. config File To Host A Blazor App In IIS.

To configure IIS to host Blazor follow this thread https://docs.microsoft.com/en-us/iis/manage/creating-websites/scenario-build-a-static-website-on-iis

Host and deploy ASP.NET Core Blazor WebAssembly
https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-6.0

The below thread discusses the same issue and you can try out some troubleshooting steps from this and see if that helps you to sort the Issue.

Blazor WASM on Windows 2016 Server Hosted with IIS, Authentication Token failed https://docs.microsoft.com/en-us/answers/questions/432718/blazor-wasm-on-windows-2016-server-hosted-with-iis.html

Hope this resolves your Query!!


--If the reply is helpful, please Upvote and Accept it as an answer–

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.