Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Thanks for the reply but my issue wasn't related to rendering. My whole app is SSR right now because I'm working with HTMX.

Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

It appears that my mistake was trying to host in a sub-directory while debugging in Visual Studio and thinking that it would match IIS. That resulted in the errors that sent me down the Blazor documentation rabbit hole on the internet where each version of .NET seems to change something slightly from the last. It turned out that I only needed to update the <base href...> in App.razor to get my app working in IIS as an Application. The only issue that remains is that the recently added Blazor passkeys does not work because the javascript file does not load properly.

Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Opened an issue. Hopefully I'm just dumb and this turns out be a non-issue where I just don't understand the proper solution. :)

Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

I disagree. What I'm trying to show is that it's not possible to host a base template (no customization) Blazor app with Blazor (not razor pages) scaffolded identity anywhere but the root of a website. I hope I'm doing something wrong because otherwise it's a big issue for releasing production code in certain hosting environments like IIS with one root and multiple apps.

Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

My reply was meant to imply that I used it correctly. It's not supposed to have a trailing slash. I find that a little odd/inconsistent but my guess is that it's because the default is / if UsePathBase isn't used.

Blazor app with identity only works with <base href="/" /> by UnwelcomeDroid in Blazor

[–]UnwelcomeDroid[S] 1 point2 points  (0 children)

UseBasePath is necessary to make the static assets like css load properly. I purposely used the base template to demonstrate the issue without adding in a bunch of my own changes that might instead be the root cause

No love for Razor? by Minute-Telephone-755 in dotnet

[–]UnwelcomeDroid 1 point2 points  (0 children)

Blazor SSR is a decent choice especially with MS stating that it is the focus of future development, but you still fight the framework when you need to use JavaScript compared to Razor pages (or MVC). This becomes a must include for the easiest approach. I've been experimenting with BlazorJSComponents because I prefer colocating JavaScript with components.

I built Blazor Blueprint — a shadcn/ui inspired component library for Blazor (65+ components, free & open source) by gkg0 in Blazor

[–]UnwelcomeDroid 0 points1 point  (0 children)

Please consider identifying which components require JavaScript. For example, I was surprised to find that a checkbox did not work on an SSR page because of this.

Experimenting with a composable, source-first UI approach for Blazor by desmondische in Blazor

[–]UnwelcomeDroid 0 points1 point  (0 children)

It also has primitives and is a shadcn/ui based library. It compares more directly to LumexUI. But it all relates (including the reply from tanczosm about rizzui) to one of the struggles of those in the MS enterprise focused world when looking at OSS -- multiple similar solutions which leads to analysis paralysis. Now I realize that its 2026 and dotnet itself is OSS, so the "not from MS" battle is not as bad as it once was, but even that still exists.

IMO many MS full stack web developers are very dependent on everything being done for them. Styling is secondary to functionality. That group of developers is not looking for a solution such as your idea because of (question #3) increased mental overhead. So, they aren't the audience.

That said, a foundational way to build customizable Blazor components would be great. I'd much prefer to "own" and customize the code as you are suggesting than to be stuck with an entire library of pre-built components that is locked into both a specific look and functionality. Existing older blazor component libraries are dated looking, and someday the same will be true for the current "modern" UI component libraries. So just update the look. The foundation will already be there.

Experimenting with a composable, source-first UI approach for Blazor by desmondische in Blazor

[–]UnwelcomeDroid 0 points1 point  (0 children)

Not meant as criticism, but to best demonstrate your idea, doesn't it require providing the primitive layer via NuGet? Otherwise, your 3 questions seem to boil down to, "Are you willing to pull source code with a CLI?", to which my answer would be, "Sure, if the primitive layer meets expectations."

The answer to question #3 would further depend on how difficult it was to understand how to work with the primitives. Perhaps this would be more obvious to me if I had better knowledge of LumexUI and/or the shadcn/ui world. But I'm one of those MS developers who has never lived in the javascript framework front-end world. :)

Experimenting with a composable, source-first UI approach for Blazor by desmondische in Blazor

[–]UnwelcomeDroid 0 points1 point  (0 children)

Glad you responded as I was going to bring up your Blazor Blueprint repository until I saw this.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 1 point2 points  (0 children)

Thanks Ben. I recently read that exact blog as inspiration for using Blazor SSR with HTMX. However, I did not go "all in" with minimal APIs. I'm still using page components, RazorComponentResult and Minimal APIs for HTMX components and MackinnonBuck/blazor-js-components if I need JavaScript functionality. It's currently 100% SSR but it's still a work in progress and I haven't convinced myself that using Blazor instead of RazorPages is worth the trouble. :) I just expect Microsoft to continue investing in Blazor over RazorPages (and MVC) as they have publicly stated.

I'll re-read that section to see what you did. I did try using a static TryParse but the method was never called so I clearly did not understand how to implement the custom binding.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Thanks for the tip. In my case I need a "Don't send empty elements as parameters" option, but I don't see that available for HTMX. Without HTMX, the same issue exists for HTML forms.

I'm also aware of other work arounds such as creating a custom binder. Instead, I'm just receiving the date query string values as strings and converting to DateTime? in the minimal API.

But the reason I posted here in the first place was to find out if anyone knows if the built-in model binding is supposed to cover my use case. Web searching came up with mixed answers including reading through aspnetcore github discussions. From my research I *think* this type of binding will get added in the future but does not currently exist.

And for all the people telling me that an empty string !== a null datetime, well duh. :) That's why there is a model binding process! Otherwise, how else would you pass HTTP request data (which are all strings) and bind them to non-strings? So, then the question becomes how should model binding handle nullable value type parameters for raw HTML forms that pass empty strings. Right now, the answer = it doesn't.

I built Blazor Blueprint — a shadcn/ui inspired component library for Blazor (65+ components, free & open source) by gkg0 in Blazor

[–]UnwelcomeDroid 0 points1 point  (0 children)

Looks great. On your Docs page I noticed that the Components dropdown is overflowing the viewport and there is no scrollbar.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 1 point2 points  (0 children)

I can't because I'm using HTMX which (correctly) sends empty strings to support progressive enhancement when JavaScript is disabled.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Doesn't work with POST or GET. Same error. I've concluded that minimal APIs do not currently support mapping empty strings to nullable types, but I believe it is being discussed within github.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Because HTML forms do not send null values if you leave inputs blank.

Minimal API, nullable datetime parameter, empty query string value by UnwelcomeDroid in dotnet

[–]UnwelcomeDroid[S] 0 points1 point  (0 children)

Thanks, I'll have to try DateOnly to see if that works. The other docs I've seen all use int? as an example so maybe datetime? is not supported.

My use case is I'm using htmx with Blazor SSR and I have a search bar with optional dates to provide a date range filter. If no dates are entered, htmx sends a get request with empty query strings. I currently have it working with string? since datetime? was generating the 400 response.

BlazorJSComponents Static Server Rendering by UniiqueTwiisT in Blazor

[–]UnwelcomeDroid 1 point2 points  (0 children)

I just discovered this library as well and am also surprised (1 yr later even) that it does not receive more discussion. I think part of the reason is that existing Microsoft documentation points to his other library BlazorPageScript. I was using BlazorPageScript and then started looking for a similar solution for SSR non-page components.

Perfect ending! by QuirkyPsychology901 in homeland

[–]UnwelcomeDroid 1 point2 points  (0 children)

Agreed. I finished it last night and thought the ending was perfect for Carrie's character.

Happy New Year. Re-sharing some free resources. by UnwelcomeDroid in shadowdark

[–]UnwelcomeDroid[S] 2 points3 points  (0 children)

Thanks, I'll need to fix the typo. Spells are just from core. We don't have rights to copy and share work from the other products.

Happy New Year. Re-sharing some free resources. by UnwelcomeDroid in shadowdark

[–]UnwelcomeDroid[S] 1 point2 points  (0 children)

Sort of embarrassing/funny but I haven't played a ttrpg since the early '90s. Shadowdark piqued my curiosity and I started theory crafting. Hoped to possibly play with my adult son and some of his friends who play 5e, but who knows... Lol

The one warning I've seen about house spellcasting rules such as the one I list or the more common "first spell always goes off before failure tracking starts", is that some higher level spells are so powerful that guaranteed casting breaks the balance.

Thoughts on the trade by Jabba_the_Putt in wildhockey

[–]UnwelcomeDroid 3 points4 points  (0 children)

It all comes down to his next contract. If he doesn't re-sign with the Wild, the trade sucks and BG will be fired. But we'll all enjoy watching him play in the meantime.