blazor

Recompile .razor files on save for Blazor WASM

旧街凉风 提交于 2021-01-27 18:40:28
问题 Is there a way to make Blazor Webassembly recompile .razor files when they're changed/updated and then saved? I'm used to this happening both in traditional ASP.NET Core MVC razor views as well as client-side frameworks like Angular. In ASP.NET Core MVC >3.0, something like services.AddRazorPages().AddRazorRuntimeCompilation(); would do the trick, but nothing exists for Blazor that I could find. It's annoying when I need to stop the entire application and restart it to see the latest changes.

Using RemoteAuthenticatorView OnLogInSucceeded gives a second AzureAD login dialog box

若如初见. 提交于 2021-01-27 18:16:18
问题 Having trouble to understand what going on and I really could use some thoughts and inputs. Please, I am not very good at describing in text what is the problem, so be gentle. I have a Blazor wasm frontend and a Azure Function backend. I do a standard, nothing special, Azure AD login. Later in code, I connect with the AzFunction using the bearer token, and it works. The AzFunction evaluates the token and identifies the user for further processing. I should mention that the AzFunction connects

Blazor with AzureAD Auth, Context.Identity.User.Name is null

丶灬走出姿态 提交于 2021-01-27 12:59:56
问题 Only authenticated users can access the application as expected. I need to be able to track users via signalr. For example, if I run a ChatHub type of service, I'd like people to be able to chat using their AzureAD username which should be set automatically and not let people set their own usernames. The hub always shows Context.Identity.User.Name is null. services.AddAuthentication(AzureADDefaults.AuthenticationScheme) .AddAzureAD(options => Configuration.Bind("AzureAd", options)); services

Reading static files in ASP.NET Blazor

一曲冷凌霜 提交于 2021-01-27 12:21:53
问题 I have a client side Blazor Application. I want to have an appsetting.json file for my client-side configuration like we have an environment.ts in Angular. For that, I am keeping a ConfigFiles folder under wwwroot and a JSON file inside of it. I am trying to read this file as below. First get the path: public static class ConfigFiles { public static string GetPath(string fileName) { return Path.Combine("ConfigFiles", fileName); } } Than read it: public string GetBaseUrl() { string T = string

Reading static files in ASP.NET Blazor

拥有回忆 提交于 2021-01-27 12:21:02
问题 I have a client side Blazor Application. I want to have an appsetting.json file for my client-side configuration like we have an environment.ts in Angular. For that, I am keeping a ConfigFiles folder under wwwroot and a JSON file inside of it. I am trying to read this file as below. First get the path: public static class ConfigFiles { public static string GetPath(string fileName) { return Path.Combine("ConfigFiles", fileName); } } Than read it: public string GetBaseUrl() { string T = string

How to render a Blazor component into an HTML string

天大地大妈咪最大 提交于 2021-01-22 00:31:33
问题 I'm looking for a way to render a Blazor component into an HTML string, so that I'll be able to use it as a templating engine to create and send emails in my web application. Ideas? 回答1: Yes, you can use the test library provided by Steve Sanderson and adapt it to your needs. This article explains how to use it : Introduction to Blazor Component Testing . The library can be use to generate the HTML of a component. exemple : var host = new TestHost(); var component = host.AddComponent

How to download in-memory file from Blazor server-side

独自空忆成欢 提交于 2021-01-21 08:35:13
问题 Is there a way to download a file, generated dynamically in memory in Blazor Server Side without need to store it on a filesystem? 回答1: The solution was in adding Web Api contoller into Blazor server side app. Add Controllers/DownloadController.cs controller to the root of Blazor app: [ApiController, Route("api/[controller]")] public class DownloadController : ControllerBase { [HttpGet, Route("{name}")] public ActionResult Get(string name) { var buffer = Encoding.UTF8.GetBytes("Hello! Content

Sending Push Notifications to iOS from PWA

纵然是瞬间 提交于 2021-01-21 04:11:48
问题 I'm sorry, I know this question has been asked before but I couldn't find updated answer. I've got a Progressive Web App which made with Blazor WebAssembly and I was wondering if I can send push notifications to iOS devices? Although people said if works now on Safari on MacOS, Push API's website says that it does not support Safari on iOS. Do I need to wrap every web app if I target iOS? I don't have a MacBook, do I need to buy one just to achieve this? Also there are Firebase and Azure

Sending Push Notifications to iOS from PWA

可紊 提交于 2021-01-21 04:11:16
问题 I'm sorry, I know this question has been asked before but I couldn't find updated answer. I've got a Progressive Web App which made with Blazor WebAssembly and I was wondering if I can send push notifications to iOS devices? Although people said if works now on Safari on MacOS, Push API's website says that it does not support Safari on iOS. Do I need to wrap every web app if I target iOS? I don't have a MacBook, do I need to buy one just to achieve this? Also there are Firebase and Azure

Sending Push Notifications to iOS from PWA

Deadly 提交于 2021-01-21 04:09:49
问题 I'm sorry, I know this question has been asked before but I couldn't find updated answer. I've got a Progressive Web App which made with Blazor WebAssembly and I was wondering if I can send push notifications to iOS devices? Although people said if works now on Safari on MacOS, Push API's website says that it does not support Safari on iOS. Do I need to wrap every web app if I target iOS? I don't have a MacBook, do I need to buy one just to achieve this? Also there are Firebase and Azure