lycian
lycian
CC#
Created by Jacko on 2/20/2025 in #help
StreamJsonRpc Question:
JSON-RPC itself is a protocol, that's an implementation used in quite a few products
3 replies
CC#
Created by Jacko on 2/20/2025 in #help
StreamJsonRpc Question:
Short answer is yes. Assuming you're talking about https://github.com/Microsoft/vs-streamjsonrpc
3 replies
CC#
Created by Jacko on 1/24/2025 in #help
Restrict loaded assemblies:
(Sorry, been a hectic 24 hours) You can provide your own hook when assemblies are loaded and reject them. It sort of solves the problem but like most things it doesn't fully restrict. The best way for that would be to use OS specific restrictions and another process
11 replies
CC#
Created by Jacko on 1/24/2025 in #help
Restrict loaded assemblies:
the other option would be using process boundaries and restricting access that way. If their process can't access the file system/network/etc then you're providing your own security
11 replies
CC#
Created by Jacko on 1/24/2025 in #help
Restrict loaded assemblies:
You'd like have each plugin in it's own ACL with the host providing the communication types https://github.com/dotnet/runtime/issues/96207#issuecomment-1875311453
11 replies
CC#
Created by SKJonathan on 1/17/2025 in #help
Maui.Graphics, using a razor file instead of a .xaml.cs file
No idea what beam graphics is but you can definitely have a Beam.razor.cs or put code in an @code block (I suggest the former). Then you'll just need to use an html canvas instead of a GraphicsView . There's a package https://github.com/BlazorExtensions/Canvas to help make it easier to use in blazor
3 replies
CC#
Created by Destination Unknown on 1/16/2025 in #help
Read file from wwwroot in Blazor web app
That doesn't look like the full error message but in the templates they do
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
and
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>("sample-data/weather.json");
Would need more info or the full exception to help more
5 replies
CC#
Created by OTDL on 1/3/2025 in #help
C# api response infinitly loading and stops debuging with working api and blazor
Also in the future follow $code
6 replies
CC#
Created by OTDL on 1/3/2025 in #help
C# api response infinitly loading and stops debuging with working api and blazor
It's already in an async method so no need to try to do things synchronously. If you want to run them all just do
var categoryTasks = categoriesResponse.Select(async x =>
{
var count = await GetItemsInCategory(x.Id);
return new CategoryViewModel
{
Id = x.Id,
Name = x.Name,
Count = count
};
});

var results = await Task.WhenAll(categoryTasks);
ViewModel.CategoriesList = results.ToList();
var categoryTasks = categoriesResponse.Select(async x =>
{
var count = await GetItemsInCategory(x.Id);
return new CategoryViewModel
{
Id = x.Id,
Name = x.Name,
Count = count
};
});

var results = await Task.WhenAll(categoryTasks);
ViewModel.CategoriesList = results.ToList();
6 replies
CC#
Created by Oliver on 12/18/2024 in #help
Optimizing Large i18n Loading in Blazor
If you add a benchmark/manual test that isn't in WASM does the deserialization happen much faster?
14 replies
CC#
Created by Oliver on 12/18/2024 in #help
Optimizing Large i18n Loading in Blazor
Have you tested the serialization/deserialization outside of WASM to make sure there's no perf issues there? What library are you using? If you did it in pure JS would it be faster?
14 replies
CC#
Created by bvko on 12/18/2024 in #help
Custom JsonConverter to apply to interface or abstract class, anyone ?
Although I would recommend switching to System.Text.Json if you can
14 replies
CC#
Created by bvko on 12/18/2024 in #help
Custom JsonConverter to apply to interface or abstract class, anyone ?
I think the easiest way if you have an abstract base is to have either an int or enum for representing the type id and doing something like this https://stackoverflow.com/questions/20995865/deserializing-json-to-abstract-class
14 replies
CC#
Created by David on 12/17/2024 in #help
MSBuild Condition for Design-Time and Compile-Time
This sounds like a very odd use case but if you need to do something in design time only follow https://github.com/dotnet/project-system/blob/main/docs/design-time-builds.md#determining-whether-a-target-is-running-in-a-design-time-build
7 replies
CC#
Created by v0fbu1vm on 12/17/2024 in #help
Include directory only in DEBUG.
Depends on how it's included. If it's just an include item you can use Condition="'$(Configuration)' == 'Debug'
12 replies
CC#
Created by kopale. on 12/16/2024 in #help
Azure Static Web App (Blazor) problem with CORS
this was with a slight modification to the template https://github.com/ryzngard/WASM_Static
16 replies