Blazor WebAssembly 3.2.0 Release Candidate now available

Daniel Roth

Daniel

The Blazor WebAssembly Release Candidate is here! This release contains all of the features and improvements that we expect to release for the upcoming Blazor WebAssembly release. There are no more breaking changes planned at this point. Please give the Blazor WebAssembly Release Candidate a try and let us know what you think!

Here’s what’s new in this release:

  • Custom boot resource loading
  • API reference docs

Get started

To get started with Blazor WebAssembly 3.2.0 Release Candidate, install the latest .NET Core 3.1 SDK.

NOTE: Version 3.1.201 or later of the .NET Core SDK is required to use this Blazor WebAssembly release! Make sure you have the correct .NET Core SDK version by running dotnet --version from a command prompt.

Once you have the appropriate .NET Core SDK installed, run the following command to install the updated Blazor WebAssembly template:

dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-rc1.20223.4

If you’re on Windows using Visual Studio, we recommend installing the latest preview of Visual Studio 2019 16.6. For this preview, you should still install the template from the command-line as described above to ensure that the Blazor WebAssembly template shows up correctly in Visual Studio and on the command-line.

That’s it! You can find additional docs and samples on https://blazor.net.

Upgrade an existing project

To upgrade an existing Blazor WebAssembly app from 3.2.0 Preview 5 to the 3.2.0 Release Candidate:

  • Update all Microsoft.AspNetCore.Components.WebAssembly.* package references to version 3.2.0-rc1.20223.4.
  • Update any Microsoft.AspNetCore.Components.WebAssembly.Runtime package references to version 3.2.0-rc1.20222.2 (having a reference to this package is uncommon).
  • Update all System.Net.Http.Json package references to 3.2.0-rc1.20217.1

You’re all set!

Custom boot resource loading

When a Blazor WebAssembly app loads in the browser, it first downloads all of the required boot resources from the server, including the .NET runtime, the bootstrapping JavaScript code, locale specific data, and the .NET assemblies that make up the app. You can now customize how these boot resources are loading using the loadBootResource API. You can use this API to make any needed modifications to how these specific outbound requests are constructed. For example, you might want to load some of the resources from an external CDN. Although Microsoft does not currently host the Blazor framework files on any specific public Content Delivery Network (CDN), you are free to add them to your own CDN if you wish. For example, if you have published the _framework\wasm files to a CDN within the base URL https://mycdn.example.com/blazorwebassembly/3.2.0-rc1/, then you could configure your application to use those resources as follows:

<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
    Blazor.start({
        loadBootResource: function (type, name, defaultUri, integrity) {
            console.log(`Will load '${type}' with name '${name}' from URI '${defaultUri}' and integrity '${integrity}'`);

            switch (type) {
                case 'dotnetjs':
                case 'dotnetwasm':
                case 'timezonedata':
                    return `https://mycdn.external.cdn/blazorwebassembly/3.2.0-rc1/${name}`;
            }

            // Other types are 'assembly' and 'pdb' but you probably wouldn't want to fetch those from a CDN as they would be custom-linked for your app
            // By returning undefined for other types, we let the framework use its normal strategy for those types
        }
    });
</script>

If you want to customize more than just the URLs that are being used, then your loadBootResource function can call fetch directly and return the result. For example:

<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<script>
    Blazor.start({
        loadBootResource: function (type, name, defaultUri, integrity) {
            // Adds a custom HTTP header to the outbound requests
            // To retain the default integrity checking behavior, it's necessary to pass through the 'integrity' parameter
            return fetch(defaultUri, { 
                cache: 'no-cache',
                integrity: integrity,
                headers: { 'MyCustomHeader': 'My custom value' }
            });
        }
    });
</script>

API reference docs

API reference docs for the Blazor WebAssembly namespaces (Microsoft.AspNetCore.Components.WebAssembly.*) are now available in the .NET API browser as part of the ASP.NET Core 3.1 API docs.

Known issues

  • When publishing a ASP.NET Core hosted Blazor WebAssembly app using Visual Studio, satellite assemblies from the client application do not get copied to the publish folder.

    This issue will be addressed in the upcoming release. To workaround this issue, publish the app from the command line using dotnet publish.

Feedback

This is our last planned preview release of Blazor WebAssembly 3.2! We need your help to make sure that we’ve addressed any remaining blocking issues for the upcoming release. Please give it a try and let us know what you think by filing issues on GitHub.

We hope you enjoy the Blazor WebAssembly Release Candidate and thanks for trying out Blazor!

93 comments

Leave a comment

  • Wade Balzer
    Wade Balzer

    Hi Daniel,

    Do you know if anyone has figured out the problem with the Register link in MS Edge? I have never got it to work in any of the releases. Maybe it is just my machine running MS Edge and every VM I create and update? It DOES seem to work in Chrome, but it has definitely never worked for me in MS Edge.

    crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
          Unhandled exception rendering component: Invalid calling object
          TypeError: Invalid calling object
             at Anonymous function (https://localhost:44321/_framework/blazor.webassembly.js:1:9866)
             at Promise (native code)
             at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44321/_framework/blazor.webassembly.js:1:9835)
             at _mono_wasm_invoke_js_marshalled (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:171315)
             at Module[_mono_wasm_invoke_method] (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:195702)
             at BINDING.call_method (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:160862)
             at Anonymous function (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:163131)
             at beginInvokeDotNetFromJS (https://localhost:44321/_framework/blazor.webassembly.js:1:41356)
             at s (https://localhost:44321/_framework/blazor.webassembly.js:1:8558)
             at e.invokeMethodAsync (https://localhost:44321/_framework/blazor.webassembly.js:1:9634)
    Microsoft.JSInterop.JSException: Invalid calling object
    TypeError: Invalid calling object
       at Anonymous function (https://localhost:44321/_framework/blazor.webassembly.js:1:9866)
       at Promise (native code)
       at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44321/_framework/blazor.webassembly.js:1:9835)
       at _mono_wasm_invoke_js_marshalled (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:171315)
       at Module[_mono_wasm_invoke_method] (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:195702)
       at BINDING.call_method (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:160862)
       at Anonymous function (https://localhost:44321/_framework/wasm/dotnet.3.2.0-rc1.20222.2.js:1:163131)
       at beginInvokeDotNetFromJS (https://localhost:44321/_framework/blazor.webassembly.js:1:41356)
       at s (https://localhost:44321/_framework/blazor.webassembly.js:1:8558)
       at e.invokeMethodAsync (https://localhost:44321/_framework/blazor.webassembly.js:1:9634)
      at System.Threading.Tasks.ValueTask`1[TResult].get_Result ()  in :0 
      at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync (Microsoft.JSInterop.IJSRuntime jsRuntime, System.String identifier, System.Object[] args)  in :0 
      at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore`1[TAuthenticationState].OnParametersSetAsync ()  in :0 
      at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion (System.Threading.Tasks.Task task)  in :0 
      at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync ()  in :0 
      at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle)  in :0 
    blazor.webassembly.js (1,37753)
      • Wade Balzer
        Wade Balzer

        I figured out the issue. It’s still a bug, but now I understand the discrepancy. When I install Windows 10 v. 1909, and perform all needed Windows Updates, and I install VS 2019 v16.6 updated to Preview 5, and install the latest Blazor WASM,… at no time was I made aware that my version of MS Edge was not sufficient, or that I needed to download a newer version of Microsoft Edge. Yes… I remember reading that I needed a Chromium based browser such as MS Edge, but that didn’t inform me that my version was inadequate. That just told me that if I had MS Edge, I was “good to go”. By default… most everyone in my company will not have updated to the new version of MS Edge if it isn’t part of a Windows Update… and trust me… I assumed because there were no updates available, I had the latest. I was running:

        Microsoft Edge 44.18362.449.0
        Microsoft EdgeHTML 18.18363

        When I UPDATED to Version 81.0.416.68 (Official build) (64-bit), the problem I have been having went away.

        That leads me to the next question… Which browsers are officially supported, and will there be a mass rollout of the new MS Edge? I’m trying to decide what I need to do for backwards compatibility or some fall back support for older browsers.

          • Wade Balzer
            Wade Balzer

            Hi Daniel, I appreciate the clarification on the browsers supported. My issue is that until the new MS Edge is included in a Windows Update, or a new distribution of Windows 10, a user is required to somehow be notified that the new Edge exists, and that they would need to manually download and update their system. Currently, the most current MS Edge browser available in a Windows update is the Legacy Edge Browser which has the problem. Since I began reporting this issue, it was only when you told me that you were running Edge v81 that I discovered the discrepancy with my Edge v44 which then led me to Google your version and find that the new Edge exists.

            All that to say.. that if the “current” Edge is still the Legacy Edge which is not a supported platform, how would be the best way to notify the user that they need to update? Is there a component that you’d recommend for Browser capabilities in Blazor?

          • Daniel Roth
            Daniel RothMicrosoft logo

            Hi Wade. Your concern makes complete sense. We’ve been talking to the Edge team about how soon they expect the new version of Edge to be rolled out on Windows Update, and it sounds like they expect that to happen reasonably soon for end users. Enterprises will of course still have control over when the new version of Edge rolls out, but we expect widespread adoption. So hopefully this will just be a reasonably short point in time issue. Unfortunately we don’t have a recommended component for detecting browser versions or capabilities. You’d most likely need some JS interop code for that.

  • Rod Macdonald
    Rod Macdonald

    With Blazor Web Assembly reaching release candidate status, is it time to start calling ‘Razor’ components ‘Blazor’ components? It’s one of those small ‘marketing’ things that make it easier to communicate new app development to customers who might want to take up on this exciting development as Build approaches.

    Haven’t tried the .NET 5 preview. For .NET 5 era Blazor Web Assembly apps, will they be running against Core or Mono, and presumably if the former, there will be breaking changes which could be significant?

    Thank you.

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Rod. It’s absolutely fine to treat Razor components and Blazor components as synonyms, but the technical term is still Razor components. The main reason for this is that we’ve learned over the years that it’s best to keep core runtime and framework concepts independent of the whims of marketing and branding.

      Blazor WebAssembly apps in .NET 5 will still be based on the existing .NET IL interpreter, but we expect to align on the same core framework library implementations as the rest of .NET Core. We also expect to enable ahead of time (AoT) compilation to WebAssembly to improve runtime performance. We do not expect any significant breaking changes as part of these changes. Blazor derives much of its value from its community and ecosystem, so maintaining compatibility is paramount.

      • Avatar
        Todd Albers

        Keeping core runtime and framework concepts independent of the whims of marketing and branding is understandable. Also, I would think backward compatibility is a factor. You don’t want to break previously created .razor projects. And one could argue that “Blazor” is really just a progressive step forward of “Razor”. So, why change the name (beyond marketing and branding)? Because even though it is the same, it’s really not. Respectfully, I think that even though they are the same in many ways, they really aren’t the same thing (beyond just marketing and branding). So, I tend to agree with Rod’s general thought\idea above.

        Note the text below is based on: I am using Visual Studio 16.7.0 Preview 1.0, with .NET Core SDK 3.2.0-rc1.20223.4, and .Net Core 3.1.300 described above. Also, if I get any details wrong here, I may be misunderstanding some things about how razor and blazor are set up and used. So, please forgive me if I get something wrong here and feel free to let me know. Also, I recognize that this is a “Preview” version of Visual Studio. But, I think that most of this is not related to whether it is a release or preview version.

        There is a difference between “Razor” and “Blazor” and pushing more toward the “Blazor” term (and away from “Razor”) reinforces that there really is something new and different about this. And there is. It isn’t just the same “Razor” platform with a different name to jazz things up. It is some new and exciting stuff, called Blazor.

        Keeping (forcing) some aspects to be known as “razor” going forward while other parts are called blazor is confusing. Here are some examples.

        In Visual Studio, in the “Create a new project” screen there is a “Blazor App” option but no “Blazor Class Library” option. Furthermore, there is a “Razor Class Library” option, but no “Razor App” option. This is a bit confusing in appearance.

        Using the “.razor” (file extension) in “blazor” projects is also a little convoluted and I think adds a bit more confusion, especially for people new to Microsoft development who are trying to “check out this new ‘blazor’ stuff”. (ie -What’s this “buzz” regarding the new “Blazor” thing that Microsoft came out with?)

        “Razor Pages” (not app or web app) is one of a few options listed under the “ASP.NET Core Application” project type (under which Blazor project type is an option also, but it’s not listed).

        If you search for “Blazor” on the “Create a New Project” screen the result is four project options but only one has the word “Blazor” in it. The results are: “Blazor app”, “Razor Class Library”, “ASP.NET Core Web Application”, and “ASP.NET Core Web Application”.

        That’s not a type-o. “ASP.NET Core Web Application” is listed twice in the results. Probably because there are two entries for options behind the scenes: one for “Razor” and one for “Blazor”. (Just a guess) But, neither descriptions for “ASP.NET Core Web Application” mention “Blazor”. (Again – Noted that this is a preview version of Visual Studio).

        I think “Razor” and “Blazor” are different and should be differentiated. I think keeping “razor” around just muddies the water more for people trying to learn Blazor.

        However, I think there is a relatively easy way to segregate actual “Razor” from “Blazor”. How about a compromise? Blazor server was released with .NET Core 3.0. Maybe do or allow this? Maybe for any “project” with TargetFramework of netcoreapp3.0 or greater, create an optional project setting named (something like): “Razor\Blazor code file extension:” or “Razor\Blazor Project Type:”. And then allow the following four options: (1) Either, (2) Both, (3) Blazor, (4) Razor.

        If the setting is missing (like in the project file for an older project built before “netcoreapp3.0”) then the setting defaults to: “(1) Either”.

        Definitions:

        (1) Either – [ie “Xor”] Allows file extensions in the same project to be exclusively either “.razor” or “.blazor”. It treats them the same. But, all files must have the same extension – either “.razor” or “.blazor”.

        (2) Both – [ie “Or”] Allows file extensions in the same project to be “.razor” or .blazor” but not exclusively. Some can be “.razor” while some can be “.blazor” It treats them the same. But, both file types can exist in same project. (Maybe not this option. I can’t think of a reason of why someone would need this. But, maybe a situation where someone is trying to convert a project from purely “razor” to purely “blazor”over time??? [so can implement webassembly for example] .)

        (3) Blazor – All files must have the extension of “.blazor”. File extensions of “.razor” error out with a suggestion to change them to “.blazor” or change this project setting.

        (4) Razor – All files must have the extension of “.razor”. File extensions of “.blazor” error out with a suggestion to change them to “.razor” or change this project setting.

        If this was implemented, current “Blazor” projects could have this option added into the project file automatically or manually after the upgrade to visual studio version that implements this. Then, you could also offer “Blazor Class Library” which would simply require the .blazor file extension (optionally) and this setting in the project file. I think that having both “Blazor app” and “Blazor Class Library” as options is clearer and better overall. It also helps promote the “marketing” and promotional aspects of this new (what some people are calling “a game changer”) “Blazor” thing that Microsoft has come out with.

        I think that would work. And it doesn’t seem too difficult to implement. I might try to jump into the Open Source code and play with the idea, but someone else can probably do it a lot easier and faster than I can as I’m not familiar with the Open Source code. And really you guys need to decide if you think it is a good idea or not first. There may be something I am not thinking of or don’t realize that makes this not possible or not a good idea. I think it is worth doing or at least considering. I think that Razor and Blazor are different.

        I also think there should be a “C# Blazor Web Developer” certification available btw. Would really like that. 🙂

        All of this is offered respectfully and is just my general take on it. I’m not sure how others might think of it. Also, there might be some things that I don’t see\realize\understand that makes this a bad or difficult implementation.

        Thank you for your consideration.

        Todd Albers

        PS – Great job, to you and your team on getting webassembly to Release! I think this is all pretty exciting progress.

  • Avatar
    Julio Avellaneda

    Good news Daniel, I’m wondering about the support to deploy a new Blazor wasm (without aspnet hosted option) application on an Azure App Service using linux version, do you know if this is possible?

    Currently I have it live as an azure storage static web site, but I want to move it to app service.

    Thanks,

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Julio. It should be possible to deploy an ASP.NET Core hosted Blazor WebAssembly app on Azure App Service Linux. If you’re finding that isn’t the case, let us know!

      What isn’t supported yet is deploying a standalone Blazor WebAssembly app to Azure App Service Linux. Unlike Azure App Service on Windows, which comes setup with IIS, the Linux version doesn’t include a web server to host the Blazor WebAssembly files. We’re working with the Azure App Service folks on what to do about that.

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Eddy. No, this isn’t the May release. That’s still to come. This is the release candidate for the May release. Just a few more weeks to go!

      No, there isn’t a .NET Core 3.2 release planned. We versioned Blazor WebAssembly as 3.2 to distinguish it from the rest of .NET Core 3.1 LTS. Blazor WebAssembly 3.2 will be a Current release, not an LTS release. We generally like to ship something a couple of times before we declare an LTS release.

  • Avatar
    Stephen Brown

    Hi Daniel,

    This is great news, so exciting that Blazor is nearing release. One question I have is around the DLL extensions. Will Blazor still download assemblies for apps with a .dll file extension? Will the general release provide a way to change this in case corporate firewalls and virus software block the downloading of these when they appear in a Blazor app?

    Thanks

  • Avatar
    Russ Sherlock

    When editing a WebAssembly .razor file, my code displays many Red Squiggles which indicate source code errors, but the project compiles without any errors?

    Typically the errors relate to methods that belong to a base class and the .razor files reference them by @inherits SomeBaseClass.
    N.B. A clean rebuild and VS restart does not solve this issue.

    Refactoring (renaming) still also fails after the second typed letter.

    Is everybody just putting up with this or is this an issue unique to me? (I have been assuming that these issues are well known)

  • Avatar
    Vincent Anzelone

    Is there any way to get Browser Link to work with Blazor WASM? I’m using the latest version of the Visual Studio 2019 Preview and have both the Web Essentials and the Microsoft.VisualStudio.Web.BrowserLink package installed. No matter what I do BrowerLink says that it’s disabled and shows no connections in the BrowserLink dashboard.

  • Avatar
    Karthik D V

    Hi Daniel, Its good to see RC 1! I’m waiting for the release.
    Is there a plan to improve the DEBUG experience and the hosting on issues without having to deal with route issues?
    I have VS 16.6.0 Preview 5.0 yet struggling to do basic debugging.
    Currently, I’m struggling to handle routes when I publish the asp.net core hosted WASM on the IIS server. Is there clear documentation on how around these routings?

  • Avatar
    Vincent Anzelone

    Will there be any support for re-compilation of razor pages (components) so that when I make a change I can just CTRL+SHIFT+R and continue or do we need to stop the debug process, make the change, restart the app? BTW, I’m loving the latest version. I have a Razor Library that I’m building all of my UI in off to the side to hopefully reuse between future project. Super exciting stuff.

  • Douglas Simao
    Douglas Simao

    [Silly question]

    As the default web assembly app with authentication and hosted asp.net core creates 1 client project and 1 server project where the server starts the client and all the security and web API etc.

    Is there any reason or recommendation about why it should be like that? I mean would be a problem if we extra the hosted, web API, and the client in 3 distinct applications where we could host in different places?

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Douglas. The current structure of the default template does simplify a few things:

      • The client knows how to find and download the authentication configuration metadata from the server so you don’t have to manually configure
      • The web APIs are hosted on the same origin as the client app so you don’t have to worry about setting up CORS

      There’s nothing that technically prevents you from splitting the server project apart. It just means you’ll need to do a bit more manual configuration.

      • Douglas Simao
        Douglas Simao

        Thank you for the explanation, was just a bit confused in the beginning as most of the videos from MS was about how flexible it was, that we could even host it in Azure blob storage as it was only static files etc, then when I saw all in the same project we can’t do those things anymore so was before it was previews was wondering if anything had changed, but for security e other reasons I think most of devs will prefer split it so we could host things in different servers, etc. but thanks for the explanation that is a really good product!

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Mark. System.Net.Http.Json version 3.2 is scheduled to ship at the same time as Blazor WebAssembly 3.2, so if you want to use a stable and supported version then we recommend sticking with 3.2. The 5.0 previews of System.Net.Http.Json should also work, but they will be in preview until the end of this year.

  • Avatar
    Mark Lawrence

    Daniel,

    I’m wondering if the team is planning any support for Visual Studio 2019’s “Quick Actions and Refactoring” tools? It would be great if the code in the Razor files could be integrated with this, so that we get the same refactoring support we have for straight C# code in the @code sections of our razor components.

    Cheers
    Mark

  • Avatar
    Taylor Watson

    Hi Daniel,

    With these new startup API’s, how do you host 2 blazor wasm apps in one wasm hosted -au project?

    I mapped different apps to their /appurl in the server app and the project runs perfectly with 1 at the new url. However, when I add a second and configure it, I can’t get it to run because the static files are compiling in the same place. I tried setting content root differently but that seemed to have no effect.

    Any advice would be wonderful. Thank you in advance!!!

    /usr/local/share/dotnet/sdk/3.1.201/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(191,5): error : Conflicting assets with the same path ‘/appsettings.Development.json’ for content root paths ‘/Users/user/Developer/WasmHosted/App1/wwwroot/appsettings.Development.json’ and ‘/Users/user/Developer/WasmHosted/App2/wwwroot/appsettings.Development.json’.

  • Avatar
    Eduardo Gómez Dorado

    Hi great job with blazor webassembly.
    I have a question because i don’t find documentation about this.

    I doing a Blazor Webassembly Hosted server role based authorization. In some part of my code i have AuthorizeView Roles=”Manager, Super Admin” for handle ui visibility. All is fine if the userinfo endpoint return only one role as string. But if the user have more than once role and user info return an array of string the authorization fails.

    any help i appreciate

  • Avatar
    Karl Cinnamond

    Super excited by the RC, our organisation is looking at mandating a new Development platform and we’re seriously watching Blazor Client for that – it always gives great confidence when you see a company using their own tech, has Microsoft any plans to develop in or port any of their products to Blazor?

  • thomas ebner
    thomas ebner

    Hi,
    is there an option/solution to control the appsettings environment and pathbase at build time?

    Current Problem:
    – I have an azure storage account to deploy my SPA ($web container in the storage account)
    – I have 4 environments for every SPA (development, test, staging, production)
    – Every environment has a own subfolder (myspa-dev, myspa-test, myspa-staging, myspa)
    – I want to build a ‘static artifact’ for every environment and copy the necessary files in the specified folder
    – A command like

    dotnet build --environment development --pathbase myspa-dev

    would be very helpful

  • Avatar
    Muhammad Ibrahiem Abdelhameed

    When will the stable version be announced?
    I have been worked with the Blazer server more than 3 months and build web applications, but there is a slow performance in UI. Is wasm solve this issue?

  • Avatar
    masoud moghaddam

    What is this error?

    Failed to find a valid digest in the 'integrity' attribute for resource 'https://4sat.4100sat.com/index.html' with computed SHA-256 integrity 'F0cOY0YuSHsALIyroBPSwqnJ+cy4LiXDEPOw9NCG39w='. The resource has been blocked.
    Unknown error occurred while trying to verify integrity.
    service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch
    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Masoud. When a Blazor WebAssembly app is built, the hashes of all the built files are saved in a manifest file, which is then used for caching purposes and to do resource integrity checks. This error could mean that the hashes were no longer valid after deploying the app, or some other error happened when trying to retrieve the file. Was index.html successfully deployed to the server? Was it perhaps modified after it was deployed?

      • Avatar
        Matteo Locher

        I am having the same error with my favicon.ico file? And also with one of my js files. But also if I run on a local machine with Visual Studio. I am 100% sure the files are not change…because all I did i press F5. Any suggestion how to debug this?

  • Fernando Roman Capparelli
    Fernando Roman Capparelli

    Hello, thanks for the RC,
    I would like to know something, I’m developing a Blazor Wasm app, and when I have to make long request, the UI is not responding after some time. The process on backend is still runnig, but UI never receive the response. Is this an issue?

    Thanks
    I’ll appreciate any answer,

    Fernando

      • Fernando Roman Capparelli
        Fernando Roman Capparelli

        Hi Daniel, the thing is when I make a request from blazor wasm to the API, I always show a modal, letting know the user that something is happening on the backend, a normal user experience process.
        But when the api take more time (than usual), because the process on backend is more complex, the modal I mentioned before, just disappear, and the response never return and actually the process on the API finish, but I don´t receive the response in the blazor wasm side.
        Is like blazor UI just crash, and the is no error on the browser console neither, so I don’t no know what’s happening.
        I’ve tried using sync and async methods, but cannot resolve it.

        Thanks for the answer before,

        Fernando

  • Avatar
    Masoud Moghaddam

    hi daniel
    im use Blazor WebAssembly 3.2.0 Preview 5 release now available core hosting
    and deploy on IIs
    but i see error :

    An SSL certificate error occurred when fetching the script.
    4sat.4100sat.com/:1 Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://4sat.4100sat.com/') with script ('https://4sat.4100sat.com/service-worker.js'): An SSL certificate error occurred when fetching the script.
    blazor.webassembly.js:1 GET https://4sat.4100sat.com/_framework/_bin/System.Runtime.CompilerServices.Unsafe.dll net::ERR_HTTP2_PROTOCOL_ERROR
    e.loadResourceWithoutCaching @ blazor.webassembly.js:1
    e.loadResource @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    e.loadResources @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    c @ blazor.webassembly.js:1
    (anonymous) @ VM328:1
    (anonymous) @ blazor.webassembly.js:1
    start @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    i @ blazor.webassembly.js:1
    Promise.then (async)
    s @ blazor.webassembly.js:1
    i @ blazor.webassembly.js:1
    Promise.then (async)
    s @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    r @ blazor.webassembly.js:1
    v @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    n @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    blazor.webassembly.js:1 GET https://4sat.4100sat.com/_framework/_bin/System.Runtime.Serialization.dll net::ERR_HTTP2_PROTOCOL_ERROR
    e.loadResourceWithoutCaching @ blazor.webassembly.js:1
    e.loadResource @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    e.loadResources @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    c @ blazor.webassembly.js:1
    (anonymous) @ VM328:1
    (anonymous) @ blazor.webassembly.js:1
    start @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    i @ blazor.webassembly.js:1
    Promise.then (async)
    s @ blazor.webassembly.js:1
    i @ blazor.webassembly.js:1
    Promise.then (async)
    s @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    r @ blazor.webassembly.js:1
    v @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    n @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    (anonymous) @ blazor.webassembly.js:1
    blazor.webassembly.js:1 Error: Failed to start platform. Reason: TypeError: Failed to fetch
        at blazor.webassembly.js:1
        at blazor.webassembly.js:1
        at Object.throw (blazor.webassembly.js:1)
        at u (blazor.webassembly.js:1)

    What should I do now?

    • Avatar
      Tim B

      I get this issue also. Both behind IIS (when using the local dev ssl cert) and also if i publish to a folder and then

      dotnet myservice.dll

      if i access using https://localhost:5001 the browser tells me the certificate isn’t valid but lets me proceed anyway.

      i can see this error in the console

      Uncaught (in promise) DOMException: Failed to register a ServiceWorker for scope ('https://localhost:5001/') with script ('https://localhost:5001/service-worker.js'): An SSL certificate error occurred when fetching the script.
  • Igr Alexánder Fernández Saúco
    Igr Alexánder Fernández Saúco

    Hello Daniel,
    I am updating to this RC1, but I run into a problem with the NavigationManager. My guess is that this issue is related with a wrong reference. I only have reference to RC1 packages.

    I think the problems comes from here, but not sure.

    I’m the author if this lib https://github.com/WildGums/Blorc.OpenIdConnect and I updated the reference but sure what I’m doing wrong.

    The fact is this NavigationManager.NavigateTo is not working for me.

  • Avatar
    dionisio luis

    Good Morning Daniel,
    I’m having issues with the PWA – Integrity Check.
    I’m using the latest version: 3.2.0.

    I’ve noticed that several people have this issue with the Integrity Check, and there is already tickets created on github, its ‘bug’ on the blazor or its just some of us that didnt manage to do it right ? or what are the solutions ?

    For me to bypass this situation im changing the code for: .map(asset => new Request(asset.url)) to bypass integrity .

    I’m trying first on my machine before deploying to the server machine to be easy to debug any issue.

    <

    p>On my Client.csproj i commented the code, just to be sure that this was not the issue.

     
     ItemGroup Condition="$(DesignTimeBuild) != 'true'">
        Content Remove="wwwroot\service-worker.js" />
        Content Update="wwwroot\service-worker.published.js" Link="service-worker.js" />
    
        Content Remove="wwwroot\index.html" />
        Content Update="wwwroot\index.published.html" Link="wwwroot\index.html" />
      /ItemGroup>
    

    –Some of the errors, I’ve more connected to the Integrity .
    Failed to find a valid digest in the ‘integrity’ attribute for resource ‘http://localhost:65364/manifest.json’ with computed SHA-256 integrity ‘9OTspAh6An7Awq5npYH73lliGm7RGgqTsse+MacJ1TU=’. The resource has been blocked.

    Failed to find a valid digest in the ‘integrity’ attribute for resource ‘http://localhost:65364/_content/Syncfusion.Blazor/styles/bootstrap4.css’ with computed SHA-256 integrity ‘UJR48OuCvN+1xUqj8gDVm+A3rAxZi7aaGK+wJRHfjlA=’. The resource has been blocked.

    • Daniel Roth
      Daniel RothMicrosoft logo

      Hi Dionisio. This error can happen for various reasons. The first thing to verify is that the files deployed are exactly the same as the files that were built and published. If they are modified in any way when publishing, then the file hash will change and the integrity check will fail. For example, we’ve seen some cases where newline characters in the files were getting modified for specific publishing flows. But this error can also happen when the file fails to download. For example, maybe the file wasn’t published at all or something is blocking the download of the file. Check to make sure that the file can actually be independently downloaded using the browser. If everything seems to be setup right and the file can be successfully downloaded, but the integrity check still fails, then please open an issue on GitHub and we’ll investigate.

  • Avatar
    Stefan Fjällemark

    Hello guys.
    Thanks for a great product. I have two requests for the further releases:
    – Run your Code Analysis and nullable enabled and fix your templates before they make it into Visual Studio. I get a long list of warnings that I’m not sure of the effect if i fix them. Better you decide what to fix and what to supress that so that compilation is free from warnings as a baseline to start with.
    – Make all scaffolded code (for example the ASP.NET Identity pages) localizable from start using the IStringLocalizer. Its a great advantage if we can translate scaffolded pages without touching the scaffolded source code.

  • Avatar
    Sergei Y.Kitáev

    Good day!
    In previous article
    https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-updates-in-net-core-3-0-preview-6/
    there were some instructions concerning corrections in ASP.NET Core 3.0 project: Before / After (UseClientSideBlazorFiles, MapFallbackToClientSideBlazor etc.). This time, having some problems with Blazor templates in RC, I need analogical instructions for migration from Preview 6 to WebAssembly 3.2.0 Release Candidate. Please, add explanation into Upgrade an existing project block — key steps in correction of ASP Web-server (for Blazor-WASM). Also any link to fresh sources (RC) of Weather Forecast sample could be helpful.
    Thanks!

      • Avatar
        Sergei Y.Kitáev

        Good day, Daniel!
        Naturally, what you are proposing is the first that comes into mind. But…
        1. Here it this post I am talking about Server project for WASM-Client. Therefore “wasmblazor”-sample template does not help. Yes, it is fresh (Include=”Microsoft.AspNetCore.Components.WebAssembly” Version=”3.2.0-rc1.20223.4″), but it contains WASM-Client only.
        2. Usage of complex sample named “blazorhosted” (Client+Server+Shared) leads to some strange result, on two different machines with .NET Core 3.1.4 and SDK 3.1.202. On the first machine I have, as it seems to me, something very old (Include=”Microsoft.AspNetCore.Blazor.Server” Version=”0.7.0″ in server project). On the second computer with fresh .NetCore+SDK — “blazorhosted”-sample template does not exist.
        That is why new WebAssemply app. is not the solution (because of secret server-side).
        In both cases the templates were installed by “dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-rc1.20223.4” command.
        I’ve also cleaned all previews on the first machine: “dotnet-core-uninstall remove –sdk –all-previews”.
        Please, recommend something proper in this situation.
        Thanks!

  • Avatar
    Stéphane Roy

    Hi,

    We have some integrity issues when using our on premise (not cloud based) Azure DevOps Server pipelines. The integrity issue is only with the DLLs.

    As an example

    bmatdvapp01/:1 Failed to find a valid digest in the 'integrity' attribute for resource 'http://bmatdvapp01:9999/_framework/_bin/Microsoft.AspNetCore.Components.dll' with computed SHA-256 integrity 'kwoDgECNJZ7WsqNcdPn3b33Ddftu8YEd+tvwHS4WrsI='. The resource has been blocked.

    Please see also Blazor WebAssembly 3.2.0 breaks integrity of DLLs

    A Visual Studio publish is fine on my local machine (although we did not test the access from another machine). Also accessing “locally” from the server to which we have deployed (using the pipelines) is fine. I even tried to use the same options when doing the publish from VS, i.e. “runtime Portable” which seemed to be the only big difference.

    Here’s the YAML for the build pipeline. We use the template “IIS website deployment” for the release pipeline.

    pool:
      name: Default
      demands: Cmd
    
    steps:
    - task: NuGetToolInstaller@1
      displayName: 'Use NuGet '
      inputs:
        checkLatest: true
    
    - task: NuGetCommand@2
      displayName: 'NuGet restore'
      inputs:
        restoreSolution: FichePompageUI/FichePompageUI.sln
        feedsToUse: config
        nugetConfigPath: FichePompageUI/NuGet.Config
    
    - task: BatchScript@1
      displayName: 'Rename pipelineRelease_Web.config to Web.config'
      inputs:
        filename: 'FichePompageUI\renameConfig.cmd'
    
    - task: DotNetCoreCLI@2
      displayName: 'dotnet publish Release'
      inputs:
        command: publish
        arguments: '--configuration Release --runtime Portable'
    
    - task: CopyFiles@2
      displayName: 'Copy publish.zip to $(Build.ArtifactStagingDirectory)'
      inputs:
        SourceFolder: '$(System.DefaultWorkingDirectory)'
        Contents: |
         **\publish.zip
         
         
         
        TargetFolder: '$(Build.ArtifactStagingDirectory)'
        CleanTargetFolder: true
        flattenFolders: true
    
    - task: PublishBuildArtifacts@1
      displayName: 'Publish Artifact: FichePompageUIDrop'
      inputs:
        ArtifactName: FichePompageUIDrop
    

    Thanks