lycian
lycian
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 WAASUL 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
CC#
Created by kopale. on 12/16/2024 in #help
Azure Static Web App (Blazor) problem with CORS
No description
16 replies
CC#
Created by cypherpotato on 12/14/2024 in #help
EF Core not creating migrations
Idr the verbosity settings but there should be a way to set to higher for better logging
11 replies
CC#
Created by cypherpotato on 12/14/2024 in #help
EF Core not creating migrations
Oh that looks frozen...
11 replies
CC#
Created by cypherpotato on 12/14/2024 in #help
EF Core not creating migrations
First guess is you're active context in VS is a different project if you have multiple
11 replies
CC#
Created by cypherpotato on 12/14/2024 in #help
EF Core not creating migrations
Have you tried
dotnet ef migrations add InitialCreate
dotnet ef migrations add InitialCreate
On the project?
11 replies
CC#
Created by Gunshot on 12/12/2024 in #help
✅ C# TCP connections Help
$code
4 replies
CC#
Created by moonbat on 12/11/2024 in #help
My Visual Studio code keeps making this error
Definitely going to need more info than that. $code
4 replies
CC#
Created by jakub on 12/9/2024 in #help
How to work with Stylus Input on Windows
I'm not as familiar with that. I've never done COM in C but it may be possible?
4 replies
CC#
Created by stigzler on 12/9/2024 in #help
Calling a method in a class running on a separate thread from the main thread
Different systems have different ways of getting to the UI thread. If you have a dispatcher instance you can use the invocation methods on that such as InvokeAsync
4 replies