blazor

URL Rewrite exceptions for Blazor WebAssembly Hosted deployment

筅森魡賤 提交于 2021-01-29 06:26:47
问题 During development, i have used Swagger on the server side of my Blazor WebAssembly App. Always launching (debug) using kestrel instead of IIS Express. Routing worked as expected, all my component routed properly and if i manually typed /swagger, i got to the swagger page. All good. We have deployed under IIS on our pre-prod servers, the Server side and Blazor WebAssembly App (client) work as expected and are usable, however, my /swagger url gets rewritten (I assume) to go somewhere in my App

how to get xls file from a ZipArchiveEntry EPPlus C#

北城以北 提交于 2021-01-29 06:01:56
问题 i'am trying to get an xls file from an ZipArchive but cant get it with EPPLUS foreach (ZipArchiveEntry entry in archive.Entries) { if (entry != null) { string filepath = entry.FullName; FileInfo fileInfo = new FileInfo(filepath); //here i got the excel package with the xls file inside the excelPackage using (ExcelPackage excelPackage = new ExcelPackage(fileInfo)) { //but here impossible de get the worksheet or workbook inside or anything else ExcelWorksheet worksheet = excelPackage.Workbook

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 Role Management Add Role trough UI (Crud)

女生的网名这么多〃 提交于 2021-01-29 00:46:46
问题 I'm pretty new to blazor and have gotten myself in some doubt on adding roles to the database. I have implemented to Identity role management and have a working system. But now i want to add new roles trough the GUI instead of editing the database. I have a razor page called RolesOverview.razor On this page i have a input field and a button. When i click this button i want to add the text to the roles manager and save it to the database. This is my razor component @page "/admin/roles" @using

Blazor Role Management Add Role trough UI (Crud)

爷,独闯天下 提交于 2021-01-29 00:45:23
问题 I'm pretty new to blazor and have gotten myself in some doubt on adding roles to the database. I have implemented to Identity role management and have a working system. But now i want to add new roles trough the GUI instead of editing the database. I have a razor page called RolesOverview.razor On this page i have a input field and a button. When i click this button i want to add the text to the roles manager and save it to the database. This is my razor component @page "/admin/roles" @using

Blazor Role Management Add Role trough UI (Crud)

左心房为你撑大大i 提交于 2021-01-29 00:40:41
问题 I'm pretty new to blazor and have gotten myself in some doubt on adding roles to the database. I have implemented to Identity role management and have a working system. But now i want to add new roles trough the GUI instead of editing the database. I have a razor page called RolesOverview.razor On this page i have a input field and a button. When i click this button i want to add the text to the roles manager and save it to the database. This is my razor component @page "/admin/roles" @using

blazor hosted template project not working after publishing the app

无人久伴 提交于 2021-01-28 21:29:57
问题 I create a new blazor hosted project, named foo, from the dotnet CLI: dotnet new blazorwasm --hosted I run the app with dotnet run -c Release The template app works correctly when requesting https://localhost:5001 (or 5000) I then publish the app with: dotnet publish -c Release And then try to launch it with dotnet Server/bin/Release/net5.0/publish/foo.Server.dll I expect the app to lanch correctly. But I actually get a 404 response. Why is that ? Notes: It was working properly few days ago.

How can I communicate between a server and client in a ASP.NET webapp?

≯℡__Kan透↙ 提交于 2021-01-28 21:08:40
问题 I want to make a pictionary like webapp. I chose to develop using the .net platform, and decided to make a blazor client with a asp.net server, but I don't know how to communicate between them. When a player is drawing something, as he/she draws, whatever he/she is drawing should appear on the other player's client, but I don't know how should to send this data to the server and back to the other clients. I took a look at gRPC but don't know if this is the right tool for this kind of

Blazor WebAssembly invoking protected WebAPI methods and relaying bearer token

青春壹個敷衍的年華 提交于 2021-01-28 20:30:54
问题 I have a restful service running on localhost:5002, Identity server on 5000 and Blazor WebAssembly app on localhost:1330. There is probably something going on with they're not all on the same domain. I can authenticate with my Blazor WebAssembly app (Client not server) Which inturn calls WebApi methods, I get returned, 401 not authorised. I've manually added the bearer token to the requests and it works perfectly returning results etc. HttpClient.DefaultRequestHeaders.Authorization = new

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