mindhardt
mindhardt
CC#
Created by mindhardt on 3/4/2024 in #help
Nuget publish with dependency
I have my library solution which has 3 projects: Core - holds base classes, required in package Generator - a source generator, required in package Sample - a test project, not required in package How do I publish only Core and Generator projects, since they do not make sense without one other I thought it would be nice to include both of them into one package? How do I achieve this? All the guides I found seem kinda confusing, for now I would be happy with "just works" solution
36 replies
CC#
Created by mindhardt on 1/15/2024 in #help
✅ Setting app's address (Blazor 8 SSR)
I have created a Blazor 8 wasm+ssr app, but after deployment my redirects broke. The app is hosted on my home server via KeenDNS (Keenetic DNS), apparently it proxies requests in such a way that redirects in ssr end up leading to addresses like http://192.168.1.45/Account/Login which is an internal address of the server in a home network I want to somehow specify the app's address so that it redirects to itself properly. Setting ASPNETCORE_URLS didn't help cuz KeenDNS url is https so asp starts asking for ssl certs that I don't own, they are managed by KeenDNS. Any ideas of how to fix this?
4 replies
CC#
Created by mindhardt on 1/13/2024 in #help
✅ Blazor on .NET 8: how to disable static prerender and return to .net 7 behavior
I have created a new blazor 8 project with wasm interactivity and Identity pages (that use Blazor ssr). When I navigate from account pages to any client page, app attempts to pre-render them with ssr while loading wasm. This behavior is not wanted since my pages have some logic that cannot be reproduced on server (like loading server file as string for future manipulations) With Blazor on .net 7 with duende it worked so any navigation from Identity pages to client triggered wasm loading animation which I am totally fine with. How do I reimplant .net 7 behavior in .net 8 Blazor?
5 replies
CC#
Created by mindhardt on 10/15/2023 in #help
✅ STJ cannot deserialize record struct with TimeOnly
See REPL. Why is this the case and what can I do? This is a json I recieve from a remote api
42 replies
CC#
Created by mindhardt on 6/20/2023 in #help
✅ Error when building ASP.NET Core 7 docker image
127 replies
CC#
Created by mindhardt on 3/4/2023 in #help
❔ ✅ EFCore: How to add entity with one-to-many relationship without navigation property in 1 query
13 replies
CC#
Created by mindhardt on 12/1/2022 in #help
✅ Access wwwroot in Blazor wasm razor
7 replies
CC#
Created by mindhardt on 10/16/2022 in #help
Won't this code cause EFCore concurrency exceptions?
public async ValueTask<Tag?> GetTag(string name)
{
if (_cache.TryGetValue(name, out object? cachedTag))
return cachedTag as Tag;

Tag? databaseTag = await _dbctx.Tags.FirstOrDefaultAsync(t => t.Name == name);

if (databaseTag is not null)
_cache.Set(name, databaseTag);

return databaseTag;
}
public async ValueTask<Tag?> GetTag(string name)
{
if (_cache.TryGetValue(name, out object? cachedTag))
return cachedTag as Tag;

Tag? databaseTag = await _dbctx.Tags.FirstOrDefaultAsync(t => t.Name == name);

if (databaseTag is not null)
_cache.Set(name, databaseTag);

return databaseTag;
}
This is the code my bot has, I am unsure if I can do DB calls like this, won't it cause concurrency exceptions? How do I fix it?
45 replies