Blazor WebAssembly 3.2.0 Preview 3 release now available

Daniel Roth

Daniel

A new preview update of Blazor WebAssembly is now available! Here’s what’s new in this release:

  • Debugging in Visual Studio and Visual Studio Code
  • Auto-rebuild in Visual Studio
  • Configuration
  • New HttpClient extension methods for JSON handling

Get started

To get started with Blazor WebAssembly 3.2.0 Preview 3 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-preview3.20168.3

If you’re on Windows using Visual Studio, we recommend installing the latest preview of Visual Studio 2019 16.6. Installing Visual Studio 2019 16.6 Preview 2 or later will also install an updated version of the .NET Core 3.1 SDK that includes the Blazor WebAssembly template, so you don’t need to separately install it.

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 2 to 3.2.0 Preview 3:

  • Update all Microsoft.AspNetCore.Components.WebAssembly.* package references to version 3.2.0-preview3.20168.3.
  • Update all Microsoft.AspNetCore.Blazor.* package references to version 3.2.0-preview3.20168.3.

You’re all set – easy peasy!

Debugging

You can now debug Blazor WebAssembly apps directly from Visual Studio and Visual Studio Code. You can set breakpoints, inspect locals, and step through your code. You can also simultaneously debug your Blazor WebAssembly app and any .NET code running on the server. Using the browser dev tools to debug your Blazor WebAssembly apps is also still supported.

Enable debugging

To enable debugging in an existing Blazor WebAssembly app, update launchSettings.json in the startup project of your app to include the following inspectUri property in each launch profile:

"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"

This property enables the IDE to detect that this is a Blazor WebAssembly app and instructs the script debugging infrastructure to connect to the browser through Blazor’s debugging proxy.

Once updated, your launchSettings.json file should look something like this:

{
    "iisSettings": {
      "windowsAuthentication": false,
      "anonymousAuthentication": true,
      "iisExpress": {
        "applicationUrl": "http://localhost:50454",
        "sslPort": 44399
      }
    },
    "profiles": {
      "IIS Express": {
        "commandName": "IISExpress",
        "launchBrowser": true,
        "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      },
      "BlazorApp1.Server": {
        "commandName": "Project",
        "launchBrowser": true,
        "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
        "applicationUrl": "https://localhost:5001;http://localhost:5000",
        "environmentVariables": {
          "ASPNETCORE_ENVIRONMENT": "Development"
        }
      }
    }
  }

Visual Studio

To debug a Blazor WebAssembly app in Visual Studio:

  1. Ensure you have installed the latest preview release of Visual Studio 2019 16.6 or later.
  2. Create a new ASP.NET Core hosted Blazor WebAssembly app.
  3. Hit F5 to run the app in the debugger.
  4. Set a breakpoint in Counter.razor in the IncrementCount method.
  5. Browser to the Counter tab and click the button to hit the breakpoint:

    Debug Counter

  6. Check out the value of the currentCount field in the locals window:

    View locals

  7. Hit F5 to continue execution.

While debugging your Blazor WebAssembly app you can also debug your server code:

  1. Set a breakpoint in the FetchData.razor page in OnInitializedAsync.
  2. Set a breakpoint in the WeatherForecastController in the Get action method.
  3. Browser to the Fetch Data tab to hit the first breakpoint in the FetchData component just before it issues an HTTP request to the server:

    Debug Fetch Data

  4. Hit F5 to continue execution and then hit the breakpoint on the server in the WeatherForecastController:

    Debug server

  5. Hit F5 again to let execution continue and see the weather forecast table rendered.

Visual Studio Code

To debug a Blazor WebAssembly app in Visual Studio Code:

  1. Install the C# extension and the JavaScript Debugger (Nightly) extension with the debug.javascript.usePreview setting set to true.

    Extensions

    JS preview debugger

  2. Open an existing Blazor WebAssembly app with debugging enabled.

    a. If you get the following notification that additional setup is required to enable debugging, recheck that you have the correct extensions installed and JavaScript preview debugging enabled and then reload the window:

    Additional setup requried

    b. A notification should offer to add required assets for building and debugging to the app. Select “Yes”.

    Add required assets

  3. Starting the app in the debugger is then a two-step process:

    a. Start the app first using the “.NET Core Launch (Blazor Standalone)” launch configuration.

    b. Then start the browser using the “.NET Core Debug Blazor Web Assembly in Chrome” launch configuration (requires Chrome). To use the latest stable release of Edge instead of Chrome, change the type of the launch configuration in .vscode/launch.json from pwa-chrome to pwa-msedge.

  4. Set a breakpoint in the IncrementCount method in the Counter component and then select the button to hit the breakpoint:

    Debug Counter in VS Code

Known limitations

There are a number of limitations with the current debugging experience in Visual Studio and Visual Studio Code. The following debugging features are not yet fully implemented:

  • Inspecting arrays
  • Hovering to inspect members
  • Step debugging into or out of managed code
  • Full support for inspecting value types
  • Breaking on unhandled exceptions
  • Hitting breakpoints during app startup
  • Debugging an app with a service worker

We expect to continue to improve the debugging experience in future releases. We appreciate your feedback to help us get the Blazor WebAssembly debugging experience right!

Auto-rebuild in Visual Studio

Visual Studio 2019 16.6 will watch for file changes in .cs and .razor files across the solution and automatically rebuild and restart the app so that the changes can be seen by simply refreshing the browser. This enables auto-rebuild support for ASP.NET Core hosted Blazor WebAssembly projects and Razor Class Libraries. Instead of manually rebuilding and restarting the app when making code changes, just edit, save, and then refresh the browser.

To use auto-rebuild, run the app using IIS Express and without the debugger attached (Ctrl-F5 instead of F5).

Auto-rebuild is not yet enabled for standalone Blazor WebAssembly projects. With standalone Blazor WebAssembly apps, you can instead edit files, rebuild the app, and then refresh the browser without restarting the web server.

Configuration

Blazor WebAssembly apps now have built-in support for loading configuration data from appsettings.json and environment specific configuration data from appsettings.{environment}.json.

To add configuration data to your Blazor WebAssembly app:

  1. Add an appsettings.json file in the wwwroot folder of your Blazor WebAssembly app:
{
    "message": "Hello from config!"
}
  1. Inject an IConfiguration instance into your components to access the configuration data.
@page "/"
@using Microsoft.Extensions.Configuration
@inject IConfiguration Configuration

<h1>Configuration example</h1>

<p>@Configuration["message"]</p>
  1. Run the app to see the configured message displayed on the home page.
  2. To optionally override this configuration with values specific to the Development environment, add an appsettings.Development.json to your wwwroot folder:
{
    "message": "Hello from Development config!"
}
  1. If you now run the app in Development, you’ll see the new message.

Note: Blazor WebAssembly apps load the configuration data by downloading the JSON files to the browser, so these configuration files must be publicly addressable. Do not store secrets in these configuration files, as they are public and can be viewed by anyone.

New HttpClient extension methods for JSON handling

The .NET team has been hard at work creating a full set of new extension methods for HttpClient that handle JSON serialization and deserialization using System.Text.Json. These extension methods are now available in preview with the System.Net.Http.Json package and they will replace the existing helper methods in the Microsoft.AspNetCore.Blazor.HttpClient package. We haven’t updated the Blazor WebAssembly template yet to use the new extension methods, but we will in our next Blazor WebAssembly preview update.

You can try the new extension methods yourself by replacing the Microsoft.AspNetCore.Blazor.HttpClient package with the newer System.Net.Http.Json package. Then add @using System.Net.Http.Json to your _Imports.razor file and update your code as follows:

Microsoft.AspNetCore.Blazor.HttpClient System.Net.Http.Json
GetJsonAsync GetFromJsonAsync
PostJsonAsync PostAsJsonAsync
PutJsonAsync PutAsJsonAsync

The updated implementation of the FetchData component in the default Blazor WebAssembly template looks like this:

@code {
    private WeatherForecast[] forecasts;

    protected override async Task OnInitializedAsync()
    {
        forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("WeatherForecast");
    }
}

System.Net.Http.Json also provides a JsonContent class that can be used for sending serialized JSON, as well as convenient helper methods for reading JSON from an HttpContent instance.

Look for more details on System.Net.Http.Json to be published soon on the .NET blog.

Known issues

There are a few known issues with this release that you may run into:

  • When building a Blazor WebAssembly app using an older .NET Core SDK you may see the following build error:
    error MSB4018: The "ResolveBlazorRuntimeDependencies" task failed unexpectedly.
    error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly '\BlazorApp1\obj\Debug\netstandard2.1\BlazorApp1.dll'. The system cannot find the file specified.
    error MSB4018: File name: '\BlazorApp1\obj\Debug\netstandard2.1\BlazorApp1.dll' 
    error MSB4018:    at System.Reflection.AssemblyName.nGetFileInformation(String s)
    error MSB4018:    at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)
    error MSB4018:    at Microsoft.AspNetCore.Components.WebAssembly.Build.ResolveBlazorRuntimeDependencies.GetAssemblyName(String assemblyPath)
    error MSB4018:    at Microsoft.AspNetCore.Components.WebAssembly.Build.ResolveBlazorRuntimeDependencies.ResolveRuntimeDependenciesCore(String entryPoint, IEnumerable`1 applicationDependencies, IEnumerable`1 monoBclAssemblies)
    error MSB4018:    at Microsoft.AspNetCore.Components.WebAssembly.Build.ResolveBlazorRuntimeDependencies.Execute()
    error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
    error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
    

    To address this issue, update to version 3.1.201 or later of the .NET Core 3.1 SDK.

  • You may see the following warning when building from the command-line:
    CSC : warning CS8034: Unable to load Analyzer assembly C:\Users\user\.nuget\packages\microsoft.aspnetcore.components.analyzers\3.1.0\analyzers\dotnet\cs\Microsoft.AspNetCore.Components.Analyzers.dll : Assembly with same name is already loaded
    

    To address this issue, update to your package reference to Microsoft.AspNetCore.Components to 3.1.3 or newer. If your project reference the Microsoft.AspNetCore.Components package through a transitive package reference that has not been updated, you can add a reference in your project to resolve the issue in your project.

  • The following error may occur when publishing an ASP.NET Core hosted Blazor app with the .NET IL linker disabled:
    An assembly specified in the application dependencies manifest (BlazorApp1.Server.deps.json) was not found
    

    This error occurs when assemblies shared by the server and Blazor client project get removed during publish (see https://github.com/dotnet/aspnetcore/issues/19926).

    To workaround this issue, ensure that you publish with the .NET IL linker enabled. To publish with the linker enabled:

    • Publish using a Release build configuration: dotnet publish -c Release. The .NET IL linker is automatically run for Release builds, but not for Debug builds.
    • Don’t set BlazorWebAssemblyEnableLinking to false in your client project file.

    If you’re hitting issues running with the linker disabled, you may need to configure the linker to preserve code that is being called using reflection. See https://docs.microsoft.com/aspnet/core/host-and-deploy/blazor/configure-linker for details.

Feedback

We hope you enjoy the new features in this preview release of Blazor WebAssembly! Please let us know what you think by filing issues on GitHub.

Thanks for trying out Blazor!

146 comments

Comments are closed.

  • Avatar
    Vladimir Chirikov

    Hi Daniel, first of all check section about vs code settings, I think should be pwa-msedge(in text was pwa-edge).
    And it didn’t work anyway from vs code. I don’t have chrome, only ms edge (and my default browser is Firefox).

  • Wade Balzer
    Wade Balzer

    Hi Daniel,

    I have the same issue out the gate of Preview 3 as before. VS 2019 v16.5.1 CLI v3.1.201 sdk v3.1.201. This time, the only options selected in WASM was ASP Core Hosted, and Individual User Accounts. I create project, and used IIS Express to run. Clicking the Register link produced the same kind of error with the option to reload.

    I also followed the recommendation on https://github.com/dotnet/aspnetcore/issues/20078, but that didn’t help. So the issue isn’t resolved for me quite yet. The only other thing that I could possibly do is create a brand new Win10 image in Hyper-V, install VS 2019 v16.5.1, v3.1.201 sdk, and Preview 3, create a brand new project and see if there is something wacky about my environment, but I usually keep my development images pretty clean.

    HTML1300: Navigation occurred.
    localhost:44338 (1,1)
    
    %cblazor%c Loaded 5.95 MB resources %cThis application was built with linking (tree shaking) disabled. Published applications will be significantly smaller.
    
    mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
    dotnet.3.2.0-preview3.20168.1.js (1,126778)
    
    crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
    blazor.webassembly.js (1,36066)
    
          Unhandled exception rendering component: Invalid calling object
    blazor.webassembly.js (1,36066)
    
          TypeError: Invalid calling object
    blazor.webassembly.js (1,36066)
    
             at Anonymous function (https://localhost:44338/_framework/blazor.webassembly.js:1:9733)
    blazor.webassembly.js (1,36066)
    
             at Promise (native code)
    blazor.webassembly.js (1,36066)
    
             at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44338/_framework/blazor.webassembly.js:1:9703)
    blazor.webassembly.js (1,36066)
    
             at _mono_wasm_invoke_js_marshalled (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:161351)
    blazor.webassembly.js (1,36066)
    
             at Module[_mono_wasm_invoke_method] (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:185518)
    blazor.webassembly.js (1,36066)
    
             at BINDING.call_method (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:151353)
    blazor.webassembly.js (1,36066)
    
             at Anonymous function (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:153622)
    blazor.webassembly.js (1,36066)
    
             at beginInvokeDotNetFromJS (https://localhost:44338/_framework/blazor.webassembly.js:1:38066)
    blazor.webassembly.js (1,36066)
    
             at s (https://localhost:44338/_framework/blazor.webassembly.js:1:8432)
    blazor.webassembly.js (1,36066)
    
             at e.invokeMethodAsync (https://localhost:44338/_framework/blazor.webassembly.js:1:9502)
    blazor.webassembly.js (1,36066)
    
    Microsoft.JSInterop.JSException: Invalid calling object
    blazor.webassembly.js (1,36066)
    
    TypeError: Invalid calling object
    blazor.webassembly.js (1,36066)
    
       at Anonymous function (https://localhost:44338/_framework/blazor.webassembly.js:1:9733)
    blazor.webassembly.js (1,36066)
    
       at Promise (native code)
    blazor.webassembly.js (1,36066)
    
       at e.jsCallDispatcher.beginInvokeJSFromDotNet (https://localhost:44338/_framework/blazor.webassembly.js:1:9703)
    blazor.webassembly.js (1,36066)
    
       at _mono_wasm_invoke_js_marshalled (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:161351)
    blazor.webassembly.js (1,36066)
    
       at Module[_mono_wasm_invoke_method] (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:185518)
    blazor.webassembly.js (1,36066)
    
       at BINDING.call_method (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:151353)
    blazor.webassembly.js (1,36066)
    
       at Anonymous function (https://localhost:44338/_framework/wasm/dotnet.3.2.0-preview3.20168.1.js:1:153622)
    blazor.webassembly.js (1,36066)
    
       at beginInvokeDotNetFromJS (https://localhost:44338/_framework/blazor.webassembly.js:1:38066)
    blazor.webassembly.js (1,36066)
    
       at s (https://localhost:44338/_framework/blazor.webassembly.js:1:8432)
    blazor.webassembly.js (1,36066)
    
       at e.invokeMethodAsync (https://localhost:44338/_framework/blazor.webassembly.js:1:9502)
    blazor.webassembly.js (1,36066)
    
      at System.Threading.Tasks.ValueTask`1[TResult].get_Result () <0x2ce1a90 + 0x0002c> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
      at Microsoft.JSInterop.JSRuntimeExtensions.InvokeVoidAsync (Microsoft.JSInterop.IJSRuntime jsRuntime, System.String identifier, System.Object[] args) <0x2acb158 + 0x000e4> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
      at Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticatorViewCore`1[TAuthenticationState].OnParametersSetAsync () <0x2d79838 + 0x00550> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
      at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion (System.Threading.Tasks.Task task) <0x2c2c460 + 0x000e6> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
      at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync () <0x2a3e420 + 0x001fc> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
      at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask (System.Threading.Tasks.Task taskToHandle) <0x2c2cfa0 + 0x000c2> in <filename unknown>:0 
    blazor.webassembly.js (1,36066)
    
     

    Thanks,

      • Wade Balzer
        Wade Balzer

        Hi Daniel, I don’t mean to keep pointing at this problem… BUT… @javiercn could not duplicate the problem and closed the ticket under the “works on my machine” rule.

        Since I have a Hyper-V server, I decided to create a brand new Windows 10 Enterprise image based on 1909 released March 17, 2020. I got all the windows updates available. Next, I installed Visual Studio Preview Enterprise v16.6.0 Preview 2, selecting ASP.Net and web development and .NET Core cross-platform development. No other options.

        Next, I opened VS Preview with Admin privilege’s. Under “Get Started”, I click Create a New Project, then select Blazor App. I accept the default name of the Project, “BlazorApp1”, and click Create. I select Blazor WebAssembly App. Under Authentication, I click “Change”, and select “Individual User Accounts”, and click OK. I check the ASP.NET Core Hosted option, noting the Author: Microsoft and Source: Templates 3.1.3, and click Create.

        Under the Package Manager Console, I run “Update-Database”. On Build Succeed. Done., I click the IIS Express button to build and run the Blazor app. I accept the security certificate install, and the BlazorApp1 opens in Microsoft Edge with a nice Hello, world!. At the top, I click “Register”. At the bottom, I get “An unhandled error has occurred.” Reload. I hit F12, and look at the console, and I have the exact same error I have mentioned above.

        Therefore, my conclusion is, this is still a problem because I am able to duplicate it on a brand new install of Windows 10, latest everything and nothing else, plus latest Visual Studio Preview v16.6.0 Preview 2 with only the options I need to create a Blazor project.

        If the problem cannot be recreated from these steps… then it must be hardware, processor, or motherboard. My Hyper-V server is a Dell server using a XEON E5-2695 v4. My normal development workstation is a Intel Core i7-5960X CPU @ 3.00GHz.

        • Daniel Roth
          Daniel RothMicrosoft logo

          Hi Wade. Thanks for these detailed repro steps! Unfortunately, I’m still unable to reproduce the error you’re seeing. One other possibility is that there is something else in your environment that is interfering with the execution of the app. Do you possibly have any browser extensions installed? Or maybe some anti-virus software is interfering?

          • Wade Balzer
            Wade Balzer

            Nope. This is a straight rebuild of Win10 v1909 March 2020 edition, Windows update, then VS 2019 Prev 2. That is it on a Hyper-V. I’m not sure how our environments are that much different from a minimal install on a fresh built virtual machine with nothing else installed.

          • Daniel Roth
            Daniel RothMicrosoft logo

            OK. Does anything suspicious show up in the network trace for the app? Are there any 404s or other errors? To see the full network traffic, first clear out the cache storage using the browser dev tools and then reload the app.

          • Wade Balzer
            Wade Balzer

            It looks like there are no missing files, so I don’t know. I’d be willing to zip up my VM and upload it somewhere it could be imported into hyper-v so that someone could take a look. Perhaps, I didn’t click an essential option when installing VS 2019 Prev2, or maybe there is an essential dependancy that isn’t automatically installed by default that causes a failure:

            at Anonymous function (https://localhost:44377/_framework/blazor.webassembly.js:1:9733)

            But my instuctions above are the exact steps I used to create my VM and reproduce the error.

          • Wade Balzer
            Wade Balzer

            Same issue… either way. I cleared my cache, built solution in release mode, ran Ctrl-F5, and still get the error. Apparently… it is an elusive problem, but duplicatable on my end.

    • Daniel Roth
      Daniel RothMicrosoft logo

      I believe that may be because IdentityServer requires a signing key for issuing tokens. In development we generate a certificate for you, but when you publish you’ll need to set one up in the hosting environment. To verify that this is what’s happening, can you look at the server logs to determine the cause of the server error?

  • Miroslav Parvanov
    Miroslav Parvanov

    Any ideas what I’m doing wrong? I’ve upgraded the project and when I put

    "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"

    inside the launchSettings.json file, I get this error on application run.

    System.ArgumentNullException
      HResult=0x80004003
      Message=Value cannot be null. (Parameter 'input')
      Source=System.Text.RegularExpressions
      StackTrace:
       at System.Text.RegularExpressions.Regex.IsMatch(String input)
       at Microsoft.AspNetCore.Builder.DebugProxyLauncher.c__DisplayClass9_0.g__OnOutputDataReceived|0(Object sender, DataReceivedEventArgs eventArgs)
       at System.Diagnostics.Process.OutputReadNotifyUser(String data)
       at System.Diagnostics.AsyncStreamReader.FlushMessageQueue(Boolean rethrowInNewThread)
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Diagnostics.AsyncStreamReader.c.b__18_0(Object edi)
       at System.Threading.QueueUserWorkItemCallback.c.b__6_0(QueueUserWorkItemCallback quwi)
       at System.Threading.ExecutionContext.RunForThreadPoolUnsafe[TState](ExecutionContext executionContext, Action`1 callback, TState& state)
       at System.Threading.QueueUserWorkItemCallback.Execute()
       at System.Threading.ThreadPoolWorkQueue.Dispatch()
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
    
      This exception was originally thrown at this call stack:
        [External Code]
    
  • Avatar
    Tichaona Dhliwayo

    Loving this tech awesome work guys, quick question since the configuration file is downloaded to the client for Blazor WASM apps what’s the best way to store sensitive configs like connection strings?

  • Avatar
    Vítězslav Stříbrný

    Hi, I tried to debug in VS (16.6 Preview 2) – it does not work for me well, the code stops at the break-point (IncrementCount method) but the Locals and Watch windows just keeps to display “Busy…” so I cannot inspect variables anyhow. It behaves the same when using Google chrome or MS Edge. Any advise, please?

    • Daniel Roth
      Daniel RothMicrosoft logo

      Can you confirm that you’re debugging an app that is using this latest release of Blazor WebAssembly? Is this an app created with the default Blazor WebAssembly template in 16.6 Preview 2, or is this an app you created previously?

      • Avatar
        Vítězslav Stříbrný

        I upgraded already existing app and forgot to update Microsoft.AspNetCore.Components.WebAssembly.Server package at server project. The “Locals” window works now.

  • Avatar
    Damiano CuriaMicrosoft logo

    Hi Daniel,
    I have updated my existing project (based on Blazor WASM 3.2.0 Preview 2) and compiled/run in VS 2019 16.6.0 Preview 2.0.
    When I start the project, the browser window opens, then it closes automatically.
    So I have created a completely new Blazor WASM project (including Core backend and PWA, no Authentication yet) and I have the same behavior: when pressing F5, the browser window opens, then it closes automatically.

    In the output window I have the following content:
    Verbose logs are written to:
    C:\Users\dacuri\AppData\Local\Temp\vscode-chrome-debug.txt
    ‘iisexpress.exe’ (CoreCLR: DefaultDomain): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Private.CoreLib.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Users\dacuri\Source\Repos\RobotStudioPOC\CUCU\Server\bin\Debug\netcoreapp3.1\CUCU.Server.dll’. Symbols loaded.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Runtime.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Server.IIS.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Runtime.Extensions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Hosting.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Hosting.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Hosting.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.DependencyInjection.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.DependencyInjection.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Collections.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\netstandard.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.ComponentModel.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.IO.FileSystem.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Hosting.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.EnvironmentVariables.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.Tasks.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Linq.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Server.Kestrel.Core.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Server.Kestrel.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Runtime.InteropServices.RuntimeInformation.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Server.IISIntegration.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.CommandLine.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.FileProviders.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.FileProviders.Physical.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Memory.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.FileExtensions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.Json.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.UserSecrets.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Runtime.InteropServices.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Configuration.Binder.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Private.Uri.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Http.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.FileProviders.Composite.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Xml.XDocument.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Private.Xml.Linq.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Private.Xml.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.Thread.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Security.Cryptography.Algorithms.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Text.Encoding.Extensions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.IO.FileSystem.Watcher.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.ComponentModel.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Collections.Concurrent.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.FileSystemGlobbing.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.Timer.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.Overlapped.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\Microsoft.Win32.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Text.Json.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Buffers.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Numerics.Vectors.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Runtime.CompilerServices.Unsafe.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Options.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.EventLog.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.Configuration.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Options.ConfigurationExtensions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.Console.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.Debug.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Logging.EventSource.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Diagnostics.Tracing.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Diagnostics.DiagnosticSource.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Http.Features.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Http.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Users\dacuri\Desktop\VS2019 P2\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\Microsoft.IntelliTrace.TelemetryObserver.Common.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Users\dacuri\Desktop\VS2019 P2\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\Microsoft.IntelliTrace.TelemetryObserver.CoreClr.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Reflection.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Reflection.Extensions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Connections.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Net.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Hosting.Server.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.HostFiltering.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.HttpOverrides.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Routing.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.ObjectPool.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Routing.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.ObjectModel.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Authentication.Core.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Authentication.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Security.Claims.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.Core.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.ApiExplorer.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Authorization.Policy.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Authorization.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.Cors.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Cors.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.DataAnnotations.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.ViewFeatures.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Linq.Expressions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Components.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.JSInterop.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.DataProtection.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.DataProtection.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Cryptography.Internal.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Antiforgery.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.WebEncoders.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Text.Encodings.Web.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.Razor.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Caching.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Caching.Memory.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Mvc.TagHelpers.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Razor.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Reflection.Emit.Lightweight.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Extensions.Localization.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Console.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\System.Diagnostics.EventLog.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Collections.Specialized.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.ComponentModel.TypeConverter.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\Microsoft.Win32.Registry.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Resources.ResourceManager.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Text.RegularExpressions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Reflection.Emit.ILGeneration.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Reflection.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Diagnostics.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.HttpsPolicy.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Users\dacuri\Source\Repos\RobotStudioPOC\CUCU\Server\bin\Debug\netcoreapp3.1\Microsoft.AspNetCore.Components.WebAssembly.Server.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.StaticFiles.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.Net.Http.Headers.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Drawing.Primitives.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Html.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Razor.Runtime.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Security.Principal.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.ComponentModel.Annotations.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Users\dacuri\Source\Repos\RobotStudioPOC\CUCU\Server\bin\Debug\netcoreapp3.1\CUCU.Shared.dll’. Symbols loaded.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Metadata.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Diagnostics.Abstractions.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Threading.ThreadPool.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\System.IO.Pipelines.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Security.Cryptography.X509Certificates.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Diagnostics.Debug.dll’.
    Microsoft.Hosting.Lifetime: Information: Application started. Press Ctrl+C to shut down.
    Microsoft.Hosting.Lifetime: Information: Hosting environment: Development
    Microsoft.Hosting.Lifetime: Information: Content root path: C:\Users\dacuri\Source\Repos\RobotStudioPOC\CUCU\Server
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\mscorlib.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Diagnostics.Process.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Collections.NonGeneric.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.WebUtilities.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Net.WebSockets.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.2\System.Security.Principal.Windows.dll’.
    ‘iisexpress.exe’ (CoreCLR: clrhost): Loaded ‘C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App\3.1.2\Microsoft.AspNetCore.Http.Extensions.dll’.
    The program ‘javascript debugger root session’ has exited with code -1 (0xffffffff).
    The program ‘[9472] iisexpress.exe: Program Trace’ has exited with code 0 (0x0).
    The program ‘localhost:44300’ has exited with code -1 (0xffffffff).
    The program ‘localhost:44300 #0 new starting [Service Worker]’ has exited with code -1 (0xffffffff).
    The program ‘[9472] iisexpress.exe’ has exited with code -1 (0xffffffff).

    Do you have any idea about what is wrong?

  • Avatar
    James Hancock

    Without lazy loading of at LEAST routes this can’t be used in Enterprise apps because every page you add makes your site load slower.

    And it is not being added until .net 5 in November.

    Making 3.2 a hello world release for the most part.

    Sad.

    • Avatar
      Darren Ford

      James, you can create your own router to do this. I did just this and can dynamically load modules including their routes. There are a couple blog posts out there on custom route topic. Oqtane has a custom router and Chris Sainty has a router specific post here: https://chrissainty.com/building-a-custom-router-for-blazor/. I do agree that to some degree most of the content around Blazor is Hello Worldy. There is still a a good bit left to be done and improve but it’s getting there.

      • Daniel Roth
        Daniel RothMicrosoft logo

        We do plan to look at adding support for lazy loading in .NET 5, but for most apps we expect that lazy loading won’t have much impact. For most scenarios, the amount of overhead for adding an additional page is small. It takes a surprising amount of app code for lazy loading to make a significant difference. This is in part because the format used for .NET assemblies, .NET IL, is a compact format that compresses pretty well.

        Take the default Blazor app for example. The transferred size of just the .NET assembly for the app, where all the app logic lives, is 6.8 KB. The total published size of the app is 2 MB with most of the size coming from the runtime and framework assemblies. Let’s say you decided to try to slim down the app size by lazy loading the FetchData page. Removing the FetchData component reduces the app assembly to 5.8 KB transferred – only 1 KB difference. There are some additional savings after linking to remove code that is no longer needed, but the total savings is still only about 18 KB. The total app size remains about 2 MB and lazy loading reduced the app size by less than 1%. What if you had 100 FetchData-like components? That adds about 40 KB. What about 1000? That adds about 350 KB.

        This isn’t to say that we don’t think there are scenarios where lazy loading will make a difference. We do think this is an important feature for certain apps, and we will look at addressing it in .NET 5 later this year. But for the many Blazor WebAssembly apps, lazy loading will most likely make very little difference.