blazor-client-side

Blazor Mono Clientside Error after updating to netcore3.0-preview8

霸气de小男生 提交于 2021-02-18 14:14:10
问题 I have updated my blazor client side project project from preview7 to preview 8, runnign with Visual Studio 2019. I have followed the instructions detailed here; ASP.NET Core and Blazor updates in .NET Core 3.0 Preview 8 However, when I build the solution get the following error; Fatal error in IL Linker 5> 5>Unhandled Exception: Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft

Blazor Mono Clientside Error after updating to netcore3.0-preview8

最后都变了- 提交于 2021-02-18 14:13:22
问题 I have updated my blazor client side project project from preview7 to preview 8, runnign with Visual Studio 2019. I have followed the instructions detailed here; ASP.NET Core and Blazor updates in .NET Core 3.0 Preview 8 However, when I build the solution get the following error; Fatal error in IL Linker 5> 5>Unhandled Exception: Mono.Linker.Steps.XmlResolutionException: Failed to process XML description: ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Microsoft

how to persist value in a singleton state container in blazor web assembly on page reload

末鹿安然 提交于 2021-02-10 23:17:36
问题 I practicing and learning blazor web assembly . I'm learning on the ways to communicate between the components. One such way is to use a state container. This works as expected however it does not sustain value on page refresh. Here is my state container class, AppState : public class AppState { public string SomeText { get; set; } } I have registered this as a Singleton instance in Program.cs builder.Services.AddSingleton<AppState>(); with this setup, I'm able to @inject AppState in multiple

how to persist value in a singleton state container in blazor web assembly on page reload

◇◆丶佛笑我妖孽 提交于 2021-02-10 23:17:32
问题 I practicing and learning blazor web assembly . I'm learning on the ways to communicate between the components. One such way is to use a state container. This works as expected however it does not sustain value on page refresh. Here is my state container class, AppState : public class AppState { public string SomeText { get; set; } } I have registered this as a Singleton instance in Program.cs builder.Services.AddSingleton<AppState>(); with this setup, I'm able to @inject AppState in multiple

How do I get the Blazor Client browser selected language? (So I can use the right decimal separator for calculations on that client browser)

冷暖自知 提交于 2021-02-10 06:20:12
问题 I try to show and use the right digit separator depending on the clients browser selected language. I'm using a Blazor Server App. I've tried to use the 'Sytem.Globalization' namespace but this only shows the settings of the Server Side browser. Is there a way to get the Client browser language/culure settings? 回答1: You could use javascripts navigator.language property via Interop. https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages public static class JsInterop {

Is there a way to serve a Blazor app from a specific controller action in a MVC app?

倾然丶 夕夏残阳落幕 提交于 2021-02-08 05:13:40
问题 I'd like to set up a controller action in a already existing ASP.NET Core 3.0 MVC project to serve a Blazor app. I've seen something similar with other SPA frameworks in the past, the View for the action just includes contains the script tag with the bundle, there's usually some other setup like having the SPA build placed on wwwroot for the MVC project. Looking at the Blazor app it seems similar to some extent, where the index.html file includes the wasm script. But I'm honestly not sure

Automatically Attaching Access Token to HTTP Client in Blazor wasm

非 Y 不嫁゛ 提交于 2021-01-29 02:05:50
问题 I am using an open id connect identity provider for my Blazor wasm application and would like an access token to be attached to the http client as described in this article. However, whenever I create the http client and try to use it I am getting an AccessTokenNotAvailableException, even when logged in. Here is what I have: In Program.cs // Add service for CustomAuthorizationMessageHandler builder.Services.AddScoped<CustomAuthorizationMessageHandler>(); // Http client for requests to API

Blazor WebAssembly - how to securely consume private/restricted API?

帅比萌擦擦* 提交于 2021-01-28 19:19:25
问题 I want to build 2 apps. Private API in .NET that takes care of database access / processing of data. Blazor WebAssembly app which will connect to this API securely, to search data. Since Blazor WebAssembly DLLs can be decompiled, I can't use any private/secret keys in the APP. I don't want anyone being able to use the API if they discover the endpoints. Only the Blazor APP can use the API (and any other app I might build in the future). How should I approach this? Is it even possible to do it

Blazor WebAssembly template not found in Blazor new project

只愿长相守 提交于 2021-01-28 05:36:52
问题 I have installed dotnet SDK 3.1.201 to Microsoft Visual Studio Professional 2019 Version 16.5.4 and I installed this template dotnet new -i Microsoft.AspNetCore.Components.WebAssembly.Templates::3.2.0-preview5.20216.8 after that I statred to create a new Blazor project in VS just only contains the Blazor Server App template I didn't find the Blazor WebAssembly App template what is wrong with all steps that I have done. 回答1: I have the same problem when I tried to install the template, my

How can I publish a blazor client/server app to a linux web server? Don't have access to ssh and dotnet publish doesn't give an index.html

爷,独闯天下 提交于 2021-01-27 22:16:03
问题 I've built a blazor app that has no issues at the moment. When I call "dotnet publish -c Release" I get a published project, except the output is an executable file that ubuntu picks up as an octet-stream or something along the lines. If I run it, it just opens the server on localhost:5000. Copying this to my web server through cpanel did nothing -- even trying to test out a generic blazor Wasm app and publishing it gave me an index.html, but it would never actually load anything when I