TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

ASP.NET Core Blazor

90 pointsby luuover 1 year ago

22 comments

RagnarDover 1 year ago
There are two major flavors of Blazor: Server and WASM.<p>Server is considerably easier to program with because it removes the complexity of making REST calls to a server component. It creates an illusion of seamless coupling between browser client and server methods. In reality, internet delay makes Blazor Server UIs unacceptably slow because UI interaction often results in a round trip call across the net. As well, every browser connection consumes significant resources on the server.<p>WASM is more difficult because of the need to use REST calls (typically) from a client project to the server side project. But the client side can be nearly entirely written in C#, targeting WASM and running in the browser - even including powerful .NET libraries (see NuGet repo.) The server code implements client services. Note that this should all sound very familiar with conventional web apps, except that a radically superior language is used instead of Javascript on the client side.<p>The ProTip is this: if you can make the choice, choose WASM. Even for an intranet app and despite the additional dev work.
评论 #37801131 未加载
评论 #37802956 未加载
评论 #37801169 未加载
评论 #37801145 未加载
taspeotisover 1 year ago
As someone who likes .NET I have never once seen a Blazor website that works well.<p>Just try dragging and dropping: <a href="https:&#x2F;&#x2F;blazordragdrop.azurewebsites.net&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;blazordragdrop.azurewebsites.net&#x2F;</a><p>The &quot;best&quot; I&#x27;ve seen has been like 100ms of latency.
评论 #37800191 未加载
评论 #37798250 未加载
评论 #37798174 未加载
评论 #37798626 未加载
评论 #37798070 未加载
评论 #37798074 未加载
评论 #37803629 未加载
wly_cdgrover 1 year ago
If you had to pick only one language to work with and trendiness wasn&#x27;t a factor, C# is the best choice. Best docs, extremely wide use case coverage, great professional community, great balance between performance, speed, and ease of use.<p>Best all-purpose language - only JS can seriously compete.
评论 #37799891 未加载
cebertover 1 year ago
Microsoft’s history with UI frameworks has been challenging, with experiences from WPF, Silverlight, and UWP leaving some developers, including myself, hesitant. It would be great to see consistent and long-term support in this area before committing to their UI solutions again. I won’t be burnt again.
评论 #37798288 未加载
评论 #37801286 未加载
评论 #37798188 未加载
TeaVMFanover 1 year ago
I you&#x27;re after something similar (write a SPA in non-JS) but you prefer Java or Kotlin, check out Flavour: <a href="https:&#x2F;&#x2F;flavour.sourceforge.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;flavour.sourceforge.io&#x2F;</a><p>Comparison to Blazor:<p>* <a href="https:&#x2F;&#x2F;frequal.com&#x2F;java&#x2F;TeaVmVsBlazorWasm1-0.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;frequal.com&#x2F;java&#x2F;TeaVmVsBlazorWasm1-0.html</a><p>* <a href="https:&#x2F;&#x2F;frequal.com&#x2F;java&#x2F;TeaVmVsBlazorChart.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;frequal.com&#x2F;java&#x2F;TeaVmVsBlazorChart.html</a><p>Flavour podcast: <a href="https:&#x2F;&#x2F;castini.frequal.com&#x2F;cast&#x2F;show&#x2F;Flavourcast&#x2F;f7e171e8-22de-4f3b-adbb-5462991343c5" rel="nofollow noreferrer">https:&#x2F;&#x2F;castini.frequal.com&#x2F;cast&#x2F;show&#x2F;Flavourcast&#x2F;f7e171e8-2...</a><p>Java Magazine article: <a href="https:&#x2F;&#x2F;blogs.oracle.com&#x2F;content&#x2F;published&#x2F;api&#x2F;v1.1&#x2F;assets&#x2F;CONT8F9404EB36BE4DBFB2A9E220E42ACCD7&#x2F;native?cb=_cache_8644&amp;channelToken=4d6a6a00a153413e9a7a992032379dbf" rel="nofollow noreferrer">https:&#x2F;&#x2F;blogs.oracle.com&#x2F;content&#x2F;published&#x2F;api&#x2F;v1.1&#x2F;assets&#x2F;C...</a><p>Real, fast-loading apps made with Flavour:<p>* Wordii, a 5-letter word game: <a href="https:&#x2F;&#x2F;frequal.com&#x2F;wordii" rel="nofollow noreferrer">https:&#x2F;&#x2F;frequal.com&#x2F;wordii</a><p>* Tea Sampler: Demo app with code samples of coding with Flavour: <a href="https:&#x2F;&#x2F;frequal.com&#x2F;tea-sampler&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;frequal.com&#x2F;tea-sampler&#x2F;</a>
评论 #37798943 未加载
mooglyover 1 year ago
A few months ago I wanted to make a really simple web frontend hosted by a WinForms app (don&#x27;t ask), and tried Blazor Server since it was going to be used by a single user on a local network.<p>I really disliked how much stuff the `blazorserver` project template created. A bunch of .razor files and .cshtml files (that had Razor code in them) in nested folders the contents of which were quite arcane. I wanted to scale it down to the absolute minimum needed, because I wouldn&#x27;t need e.g. client-side routing, but the tutorials basically repeated setting up all this boilerplate without really explaining the basics.<p>I spent a couple of hours working backwards trying to simplify this, but didn&#x27;t really succeed.<p>FWIW, I&#x27;ve worked with .NET since the 1.1 days so I tend to be used to their idioms.<p>Instead I made a Solid.js frontend hosted by in-process Kestrel and just used SignalR directly for all client&#x2F;server communication. Somehow going into the JS&#x2F;TS ecosystem (which I&#x27;ve worked a lot in too) had less friction. Very surprisingly, SignalR is not TypeScript friendly at all out-of-the-box. The frontend client could be source generated for sure, and I saw someone had made a tool for that, but still odd that it&#x27;s not first party.<p>I can appreciate the idea of making an opinionated, scalable, production worthy template (if that is what this is), because in the JS&#x2F;TS ecosystem the opposite is common with toy examples, but there is something to be said to offer a toy example to explain the underpinnings of the framework.
bottlepalmover 1 year ago
Kind of absurd the company that invented TypeScript does not embrace it at all on the frontend. No native web framework, no frontend component libraries, all while the past 20 years have suffered from wave after wave of questionably supported framework where Microsoft could have easily filled the void. Even React has been abandoned by Meta. Frameworks like Next.js and SvelteKit are eating Microsoft&#x27;s lunch in the new full stack world. Entity Framework is the only thing I really miss.
评论 #37798260 未加载
评论 #37798522 未加载
torginusover 1 year ago
Tbh, since the introduction of .NET 7 WebAssembly, Blazor isn&#x27;t my preferred way of writing .NET apps in the browser.<p><a href="https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;dotnet&#x2F;use-net-7-from-any-javascript-app-in-net-7&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;devblogs.microsoft.com&#x2F;dotnet&#x2F;use-net-7-from-any-jav...</a><p>Blazor is 2 things bundled together - a way of running .NET apps in the browser, via WebAssembly, and an SPA framework. Since .NET 7, it has become possible to use just the WebAssembly part. I prefer bundling .NET WASM, with a more traditional frontend framework, like React, since it doesn&#x27;t suffer from all those issues others have mentioned in the thread. In addition, it&#x27;s a battle-tested solution that most fronted devs are already familiar - the pool of devs writing kickass Blazor&#x2F;ASP.NET Razor sites is comparatively tiny.
评论 #37805054 未加载
MauroIksemover 1 year ago
If they made an easy way for us to move from asp web forms to blazor that&#x27;d be ideal. Not bringing web forms to core is fine but without giving us an easy way to migrate to blazor is a big problem imo. There are still a ton of apps and big code bases that run on web forms.
评论 #37798017 未加载
评论 #37798044 未加载
aardvarkrover 1 year ago
Avoid blazer like the plague. I use it in my work and the only reason why is because everyone uses C# and can’t be bothered to learn a second language. Take a wild guess which company that is. It’s an awful architecture that only exists because some exec at Microsoft willed it into existence. There’s a reason why Java doesn’t get used to program real website front ends and I’d never use C# for web dev if I weren’t forced to.
评论 #37798310 未加载
评论 #37798459 未加载
评论 #37798224 未加载
评论 #37798508 未加载
评论 #37799335 未加载
评论 #37798137 未加载
kcartlidgeover 1 year ago
Built a few things with Blazor (largely internal tooling). Feels like a cross between Meteor, WebForms, and Phoenix LiveView. Fast and simple.<p>- Server-side rendering is great for internal apps, or public facing ones where interactivity is minimal and you enforce websocket support. Lost connections are still messy, but a single codebase (literally) makes life very simple.<p>- Client-side rendering is great for internal apps, or public facing ones where users are fine with a reasonable-sized up-front traffic hit. Lost connections behave like with any other site, and you can still use shared code and libraries which work unchanged on client and server.<p>I quite like the latter. A DotNet solution with a client C# project, a server C# project, and shared code projects, with the server running an API and the client consuming it using shared models works well and supports end-to-end debugging.<p>I&#x27;m also looking forward to trying the DotNet 8 hybrid Blazor improvements.<p>That said, when doing C# I still prefer either plain ASP.Net MVC or a separate client hitting an ASP.Net Web API (pretty much the perfect mix of scalable performance and productive development).
qlkjwenfover 1 year ago
Blazor is excellent! The entire JavaScript ecosystem is so fragile and volatile, you will get JS-fatigue very quickly. Each time you change projects you have to learn completely new JS libraries, frameworks, tool, etc. No such problems with Blazor.
edandersenover 1 year ago
If you are a junior developer please do not go anywhere near this, your career will be stunted.
评论 #37798041 未加载
评论 #37798231 未加载
评论 #37803954 未加载
评论 #37799854 未加载
评论 #37798155 未加载
obeavsover 1 year ago
For those interested in .NET languages with alternative compilation targets, F#&#x27;s Elmish (<a href="https:&#x2F;&#x2F;elmish.github.io&#x2F;elmish&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;elmish.github.io&#x2F;elmish&#x2F;</a>) is pretty unique.<p>We use F# on the front end (instead of TS), and thanks to the Fable compiler (which transpiles F# to JS, Python, Dart, PHP and Rust), most of the benefits of an Elm-style model in the UI can be ported to all sorts of different outputs languages. The rust target is in beta, but its promising because the WASM bundle size stands to be dramatically reduced compared to Blazor.<p>While the default is reactivity library for Elmish is React, you can swap in Avalonia&#x2F;FuncUI (<a href="https:&#x2F;&#x2F;github.com&#x2F;fsprojects&#x2F;Avalonia.FuncUI">https:&#x2F;&#x2F;github.com&#x2F;fsprojects&#x2F;Avalonia.FuncUI</a>) with just a little work as well.
sixothreeover 1 year ago
Blazor is pretty slick. I spent some time with these videos and it might be an easy way to get going.<p>blazortrain.com
评论 #37798121 未加载
pjmlpover 1 year ago
While Blazor is a great migration path for Web Forms, it does little for companies with clear FE &#x2F; BE separation across development teams, where .NET is restricted to SSR&#x2F;SSG and APIs.
candlover 1 year ago
Haven&#x27;t touched Blazor in 2 years. In the context of blazor server, what&#x27;s the recommended pattern for state management? Does it make sense to use MVVM (e.g. via MVVM Community Toolkit for source generated observable properties etc) or plain C# objects would suffice with manually calling StateHasChanged() whenever necessary? (I guess that since rerenders are driven by DOM events the situations where manually calling StateHasChanged() is quite low)
评论 #37806277 未加载
Xeamekover 1 year ago
How does blazor (server side) compares to Phoenix liveview?
qingcharlesover 1 year ago
The OP linked to v7.0 document, but 8.0 is in RC1 and goes gold in four weeks:<p><a href="https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;aspnet&#x2F;core&#x2F;blazor&#x2F;?view=aspnetcore-8.0" rel="nofollow noreferrer">https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;aspnet&#x2F;core&#x2F;blazor&#x2F;?view=a...</a><p>(the even numbers are Long Term Support versions)
local_crmdgeonover 1 year ago
The amount I don&#x27;t like this model is remarkable.<p>Microsoft needs to just buy Vercel. They invented TS, they should lean into the huge successes there.
评论 #37800648 未加载
firemeltover 1 year ago
should I abandon rails and jump onto blazor?
wokwokwokover 1 year ago
? Is something new here?<p>Did they update the documentation layout?<p>Blazor has been around for 5 years or so now, and discussed before and this looks… the same?
评论 #37797970 未加载
评论 #37798118 未加载
评论 #37797994 未加载