0

Blazor WASM application gives error. It does not get files that are required for WASM initial load. In request of files there is an alert that says Provisional headers are shown..

To Deploy Blazor WASM application using CloudFlare in the middle. Structure of Network

Blazor WASM runs on IIS. Binding setting are as follows. IIS Binding settings

Published project file structure as follows. Published File Stucture

IIS URL Rewrite configured as follow. URL Rewrite View on IIS

Web.config file Content that contains URL Rewrite configuration

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".blat" />
      <remove fileExtension=".dat" />
      <remove fileExtension=".dll" />
      <remove fileExtension=".json" />
      <remove fileExtension=".wasm" />
      <remove fileExtension=".woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".blat" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".dll" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".dat" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".json" mimeType="application/json" />
      <mimeMap fileExtension=".wasm" mimeType="application/wasm" />
      <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
      <mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
    </staticContent>
    <httpCompression>
      <dynamicTypes>
        <add mimeType="application/octet-stream" enabled="true" />
        <add mimeType="application/wasm" enabled="true" />
      </dynamicTypes>
    </httpCompression>
    <rewrite>
      <rules>
        <clear />
        <rule name="Serve subdir">
          <match url=".*" />
          <action type="Rewrite" url="wwwroot\{R:0}" />
        </rule>
        <rule name="SPA fallback routing" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="wwwroot\" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

On CloudFlare section SSL/TLS encryption mode is selected as Flexible. CloudFlare SSL Mode

CloudFlare Record settings are as follows. Record Settings

After publishing, file getting error is shown on dev tools network screen as follows Network Screen File Error

All File have same error. Error is as follows. File Error

In addition above configuration, Blazor WASM was published from both Client and Host. When SSL/TLS is in use, it gives error both of Client and Host based publish. There is no error on Http requests.

What do i missing while publishing? What should i do?

omer yel
  • 1
  • 1

0 Answers0