Intro to SignalR in C# Part 1 - using Blazor, WPF, best practices, and more

  Рет қаралды 96,572

IAmTimCorey

IAmTimCorey

2 жыл бұрын

SignalR is an excellent way to connect two or more clients together for real-time communication. The best part is that this library is just a wrapper around web-standard technologies such as Web Sockets and Long-Polling. It just makes them easier to use. That means we can even use SignalR with other clients such as Java or JavaScript. In this video, we are going to learn how to set up SignalR and how to connect to it using web clients and desktop clients. Throughout the video, we will cover best practices, as well as how to use this in the real world.
Full Training Courses: IAmTimCorey.com
Source Code: leadmagnets.app/?Resource=Int...
Mailing List: signup.iamtimcorey.com/

Пікірлер: 264
@ManuelBasiri
@ManuelBasiri 2 жыл бұрын
I wish I had this tutorial a year ago when i was banging my head against the wall to make it work. Thank you so much Tim. You are a precious asset for the entire dev community.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@cbirchy87
@cbirchy87 2 жыл бұрын
Thanks Tim! I've half understood signalR and this has really helps concreate my understanded. Perfectly delivered, perfect pace. I really appocate your hard work in creating this free content. You have, for sure been a sigificate part of my Software Developer journey.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great to hear!
@ThangNguyen-zi8bm
@ThangNguyen-zi8bm Жыл бұрын
This is one of the best SignalR explanation that I have run across online. Thanks Tim and please keep on teaching us all the cool stuffs...
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@AlexAndVicki
@AlexAndVicki 8 ай бұрын
One of the best tutorials I have ever come across - Tim has a super pleasant voice and manner and the whole thing moves at exactly the right pace
@IAmTimCorey
@IAmTimCorey 8 ай бұрын
Thank you!
@andrewelmendorf2602
@andrewelmendorf2602 2 жыл бұрын
Glad to see signalr getting some love. I've been using it for 5-6 years now and it has come a long way!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great to hear!
@hexoter
@hexoter 2 жыл бұрын
Already using signalR for one year , but I am so excited to see your video
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great!
@lelehehe
@lelehehe Жыл бұрын
This is a great piece and it is still gold after I learned Signal R already. This gave me great perspective and it is in one piece all things considered. Thank you very much.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Excellent! I’m glad it was helpful.
@Neo8019
@Neo8019 Жыл бұрын
Once again an excellent tutorial. Your tutorials can be long but for that they are detailed and very easy to follow. Some tend to talk way to fast and it can be a pain to follow along. Thank you. Now I can upgrade the multi user application I have created.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Printoiid
@Printoiid 2 жыл бұрын
Thank you for taking my earlier comment (11 months ago under your video "C# Async / Await - Make your app more responsive and faster with asynchronous programming") into consideration of explaining the logic before just writing code.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@wladdovy4370
@wladdovy4370 2 жыл бұрын
Had the question on the interview "have you familiar with SignalR". Yeah, I have :) Thanks for video! I'll wait for part two.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@kreliz2845
@kreliz2845 Жыл бұрын
Fantastic tutorial and very well explained. I'm just an amateur, self-taught coder who likes doing little projects here and there. Needed this for one and really wasn't looking forward to it... 😅 You made it an absolute walk in the park. Thank you. 🙏
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome. I am glad it was helpful.
@lucianbumb6690
@lucianbumb6690 2 жыл бұрын
Thank you Tim for this tutorial. It's amazing how easy is 'this days' to create very powerfull applications. A big thanks to all people working to improve dotnet.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@krishnankuppaswamy7553
@krishnankuppaswamy7553 2 жыл бұрын
Loved learning new stuff here in this channel. Great efforts. Thanks, Tim 🙏
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@brianwiggins6981
@brianwiggins6981 2 жыл бұрын
Thanks I always wanted see a video from you about how to use SignalR. Thanks for all your content.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@greghayden2117
@greghayden2117 2 жыл бұрын
Very well done. Good explanations of complex topic and especially good at showing the specific pieces that make things work. You really are pretty good at this.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thank you!
@chechobecho2177
@chechobecho2177 2 жыл бұрын
Thank You Tim.. Finally SignalR Guide is here.. I have waited for this long time.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@domengolob1358
@domengolob1358 2 жыл бұрын
This SignalR video is very nice :) I would love to see more of this content. Thanks for your work on this Tim.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Glad you enjoyed it!
@jingzheshan
@jingzheshan 2 жыл бұрын
I am looking forward to hearing some of your insight on SignalR security and authenticated user to user communication.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Good to know.
@pravintml1517
@pravintml1517 10 ай бұрын
Best ever SignalR explanation, Thanks for you time & Great efforts 🙏
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
You are welcome.
@williamliu8985
@williamliu8985 2 жыл бұрын
Yeah, long time no see, WPF... WPF need more love 😍
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@empathetic24671
@empathetic24671 2 жыл бұрын
Thanks for the Signal R video Tim. Just wanted this from you🤯🤯🤯
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
My pleasure!
@TutorialsMethod
@TutorialsMethod 2 жыл бұрын
Wao much awaited topic SignalR by Best Tutor. Thank you so much.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@satyabratamohapatra3397
@satyabratamohapatra3397 2 жыл бұрын
Finally....SIGNALR💪. Thanks Tim.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@Steven23452
@Steven23452 2 жыл бұрын
Thanks Tim! Great Video! I used web sockets to rebroadcast messages from my syslog server back out to web clients .. after watching this I may spend some time moving that to SignalR!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I am glad it was so helpful.
@Mikael_Puusaari
@Mikael_Puusaari 10 ай бұрын
Awesome crash course Tim, thanks!
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
You are welcome.
@manuelgamezz
@manuelgamezz 2 жыл бұрын
Very clear explanation, thanks Tim.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@stephenadams6959
@stephenadams6959 2 жыл бұрын
Great video. Looking forward to more on the subject.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks!
@3Play4PvP
@3Play4PvP 3 ай бұрын
You get from me a well deserved like button! Explained everything so beautiful nice. I really like the way you do it.
@IAmTimCorey
@IAmTimCorey 3 ай бұрын
Thank you!
@JackNotJack
@JackNotJack Жыл бұрын
Tim, great tutorial. Thank you.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@FabricioMelos
@FabricioMelos 2 жыл бұрын
Awesome tutorial! Thanks Tim!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@hastifallah73
@hastifallah73 2 жыл бұрын
Waiting for part two ✌️ It would be great if you add signalr based by authentication
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@codefoxtrot
@codefoxtrot 2 жыл бұрын
+1 Upvoted on Tim's suggestion site
@kevinlyman1
@kevinlyman1 2 жыл бұрын
I agree. I tried this awhile ago using Azure B2C and ended up having to make the hub anonymous because I couldn't figure out how to get the token to signalR hub
@kevinlyman1
@kevinlyman1 2 жыл бұрын
@@IAmTimCorey I went there and registered and upvoted this suggestion. What do the Statuses mean? They're for the most part self explanatory, but what does "Watching' actually mean? I thought for a second you somehow knew what videos I was watching and had completed.
@TheCameltotem
@TheCameltotem 2 жыл бұрын
Done a few Azure Serverless SignalR and it's really smooth sailing and fun!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great!
@GabrielMariusPopescu
@GabrielMariusPopescu 2 жыл бұрын
Awesome course! Thanks for the video
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@evrozah1
@evrozah1 2 жыл бұрын
Exactly what i needed. Thank you.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@ButchCassidyAndSundanceKid
@ButchCassidyAndSundanceKid 2 жыл бұрын
Long awaited tutorial on SignalR.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I hope you enjoyed it.
@GPR7904
@GPR7904 9 ай бұрын
Great content like always. I'm stuck with something, Tim Corey is here to rescue. Thanks a ton Tim. Very much Appreciate your effort to make these wonderful informative videos.
@IAmTimCorey
@IAmTimCorey 9 ай бұрын
I am glad it was helpful.
@tchpowdog
@tchpowdog 2 жыл бұрын
I've been using SignalR for the last 5 years or so in production apps. I'd like to add a best practice... If any of the data going back and forth between clients is to be stored in a database, DO NOT send this data to the Hub from the client. Send the data to a controller just like you would any other data. Store the data in your DB, then broadcast that data out using the Hub. You want your Hubs to just relay data. You do not want your hubs to be the consumption endpoints for data. This is because Hub connections are not always reliable. And Hub connections will close after a period of time they are unused. To use your hub throughout your backend app, you can inject an IHubContext into your services using DI and access the hub methods just like any other service.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for sharing. I'm curious as to what circumstances led you to this conclusion. I agree that calling a controller is the better option, but in general, you can also use the SignalR connection without issue. For instance, that's what Blazor Server does for all of its data storage calls. Having a call timeout is something that shouldn't happen with an actively-used client. Plus with the auto-reconnect, it should jump right back up when you try to use it in a disconnected state.
@tchpowdog
@tchpowdog 2 жыл бұрын
@@IAmTimCorey there were several reasons I wanted to do this. 1. It made all of our application structure consistent (all POST data goes through controllers). 2. It fit our development process, we had a guy that worked on hubs and another guy that works with data storage, for example. 3. We had connection issues (although this was minor). 4. Authentication. Sending the posted data through our controllers meant we used our normal request authentication. Which is via JWT tokens passed in an HTTP header. 5. It allowed us to broadcast system generated data. For example, our chat had system messages, and using the HubContext, system chat messages were broadcasted the same way user chat messages were broadcasted.
@tchpowdog
@tchpowdog 2 жыл бұрын
@@IAmTimCorey I just highly suggest implementing it this way to save yourself in the future. It's just a lot cleaner and more flexible.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for sharing.
@harshvijaysingh442
@harshvijaysingh442 Жыл бұрын
Very well explained.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thank you!
@RobertSagoe
@RobertSagoe Жыл бұрын
you never disappoint 👌👌😉😉
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks!
@ranielgarcia8685
@ranielgarcia8685 2 жыл бұрын
This is great! Thank you!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@leonardobrogelli7527
@leonardobrogelli7527 Жыл бұрын
Thank you very much Tim!!!
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@Galraeldia
@Galraeldia Жыл бұрын
That was great, thank you very much for your content.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
You are welcome.
@pavfrang
@pavfrang 2 жыл бұрын
Great content, in fact your tutorial was enough to create the "counter" page part!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Excellent!
@AdrianTether
@AdrianTether 2 жыл бұрын
Always great an easy 2 follow
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Great to hear!
@allenbythesea
@allenbythesea Жыл бұрын
Great video on signal R, really interesting how good it is at moving messages around. I still hate WPF though.
@artzrasr4363
@artzrasr4363 2 жыл бұрын
wow thank you for this sir🤗
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@imadelberdaoui7363
@imadelberdaoui7363 2 жыл бұрын
Thank you Tim for SignalR video it was great, hope you do streaming or video communication user to user by SignalR.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Streaming video isn't really something that should be done via SignalR. There are other technologies out there that will do a better job.
@leonardzmalaj8038
@leonardzmalaj8038 2 жыл бұрын
Thanks man !!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@heshanwijerathna
@heshanwijerathna 2 жыл бұрын
100% perfect timing..
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Excellent!
@cissemy
@cissemy 2 жыл бұрын
Thanks!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome.
@S3Kglitches
@S3Kglitches 2 жыл бұрын
Thank you!!!! Note it is not Setup.cs but Startup.cs
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You are welcome. And yep, just a slip of the tongue.
@Raphael_dArc
@Raphael_dArc 2 жыл бұрын
Very clear and helpful for learning the basics of SignalR. It was also very nice to see it in action with the desktop app. One thing I noticed was the double message at 1:09:38, why did this happen?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I had double-subscribed to the event, which is why it came through twice.
@naturalwong6884
@naturalwong6884 2 жыл бұрын
Hi Tim, after completed the course of MongoDB, SignalR is next pazzle I need to build a more complex application. Thank you. I am looking for a tutorial of combining SignalR to receive data, store to MongoDB and revert to other client in real time.
@0i0l0o
@0i0l0o Жыл бұрын
The Man
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks.
@sh2983
@sh2983 2 жыл бұрын
Hi Tim, thank you for the video. Could please make a video about SinalR pricing on Azure, and the best potential hosting environments for publishing an app using SignalR with about 100 concurrent users using SignalR connection. Thanks
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@kaceyezerioha495
@kaceyezerioha495 2 жыл бұрын
Need this too for a project currently in development
@archerscherer44
@archerscherer44 Жыл бұрын
Hey Tim! Excellent walkthrough! I am curious if there was a reason for using OnInitializedAsync Vs OnParameterSetAsync for the initial signalR connection?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
"Any asynchronous operations, which require the component to re-render once they complete, should be placed in the OnInitializedAsync method." - from the documentation. Since the results of the call may put something on the page, which would cause the the component to re-render, we use the OnInitializedAsync method.
@guillermodanielmazzarigiov1768
@guillermodanielmazzarigiov1768 2 жыл бұрын
I really admire and appreciate your work! We're so you stand regarding blazor on vs code?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
VSCode is a great editor. If you can use Visual Studio, you will have more help (Intellicode, quick actions and refactoring, etc.), but VSCode is light, fast, and does not get in the way.
@ericouellet9848
@ericouellet9848 Жыл бұрын
Hi Tim, at the beginning of your video, around minute 2:30. You say "don't use core version, use not core versio which is more complete". But the core version package is bigger in size. How the core (onlky the basics) version could be bigger than the full version ?
@therealrolanddeschain9253
@therealrolanddeschain9253 2 жыл бұрын
Thanks for the great videos! I'm wondering if you have a video about how to handle images (and other files) which are not stored in Database, but on a (private) cloud storage, like azure blob, S3 or similar. For example, do you provide only pre-signed URLs to the client, or should you handle the downloading and serving yourself? What are best practices here?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
That sounds like this suggestion: suggestions.iamtimcorey.com/Details/6253bf2a0b6906f2d6876be7
@user-od2ig7gr7t
@user-od2ig7gr7t Жыл бұрын
Hi Tim, great video. So anyone can connect to the hub if they have the URL? is there a way to secure it?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yes, you can add authentication and authorization to a SignalR hub.
@leonardobrogelli7527
@leonardobrogelli7527 Жыл бұрын
Hi Tim.I want to thank you again for your explanation. I created the project following your video step by step. If I execute the server and the client (even the WPF one) on the same pc they works correctly. If I launch the client app (after changing the URI from localhost to the to the IP server) the connection fail (I have disabled the firewall on both pc too). Can you help me. Thank yuo. Leonardo. 👍👍👍
@F0YF0YT0S
@F0YF0YT0S Жыл бұрын
Hi Tim! Amazing tutorial as always. I am trying to create a simple app that utilizes two pages. On one I click on a and on the second the same appears. The app works fine on visual studio iis express and even when I publish and launch it from a custom folder on port 5000. When I try to host it so it is available on my lan using nginx my main page crashes the app. Any tips on how I could debug something like that? I am guessing it has to do with the configuration of nginx and how it deals with forwarding the signalr "messages" but I cant find a place to start. I know this is an old video but I could really appreciate your help. Thanks for the excellent content!
@nicolasensale3357
@nicolasensale3357 Жыл бұрын
Thanks for all. I don't understand why when I start the server, it listens on port 5001, while instead it should always assume a random port in its range, or connect to the port indicated in the Launchsettings.json, which in this case should be 7181. Thanks if you go answer me.
@dennisi6736
@dennisi6736 2 жыл бұрын
Tim thanks.Awesome lesson on SignalR. Question: Is it possible to send/receive other than string types i.e. complex data objects?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Yes it is. The next video will send ints, but you can send more complex types too.
@kevinlyman1
@kevinlyman1 2 жыл бұрын
I send objects through in a little app I'm playing with so yes it's possible.
@codefoxtrot
@codefoxtrot 2 жыл бұрын
Hi @IAmTimCorey, great video-- the question I had while watching this-- how does this compare to using an API project? Any advice on when you should use an API vs SignalR?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
SignalR is for maintaining a constant connection to a server. It is primarily for real-time data communication. While it can be used like an API as well, it isn't the ideal use case. An API is useful for when you need information or want to give information. You only open the connection long enough to perform the action and then you close it down again.
@mcopy9p350
@mcopy9p350 2 жыл бұрын
Hi Tim, is there a way to wrap singalr inside REST endpoints. please share any link or video.
@rafaelviniciusol
@rafaelviniciusol 2 жыл бұрын
Hi Tim! Are the Blazor and SignalR suitable for video streaming? I'm trying to make a project with this feature using Blazor. The Chat is similar with the one you are developing in the video, but I can't figure out how to do with the video without using the JS client
@tchpowdog
@tchpowdog 2 жыл бұрын
Short answer to this is no. You should use WebRTC for streaming video. There are frontend libraries for making this simpler to setup (although it's still not trivial). Remember, SignalR uses WebSockets, which means your server plays a middle-man role. Whereas, WebRTC connects two clients directly and streams data between the two (you can use SignalR to orchestrate the connection between the two clients but you won't use SignalR for streaming video/audio between the clients). I created a live meeting feature in one of my apps using WebRTC and it works really well. It's works identical to Zoom or Skype.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for sharing @Andy!
@dilipdas6305
@dilipdas6305 Жыл бұрын
Very good tutorial. Can you send image as well?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
I would recommend not doing that. Use an API to send an image. You can send a message to get an image from the API through SignalR, though.
@johncordell8661
@johncordell8661 2 жыл бұрын
Tim, thank you so much for putting content like this together. Question from an architecture standpoint. Would SignalR be a good solution within an API? Within our business, we have a web app, an API, and several dozen clients (console apps) running at customer sites. Right now, whenever we want something communicated to the client from the web, it is broadcasted to the API -> database where the client can then pick up requests. Would SignalR be a good solution from the API perspective to broadcast these requests directly to the client machines, or would you recommend a different approach.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
That could be the right solution if you need that communication channel open for real-time events. Just note that your clients will need to be connected to the API all the time. That probably isn't a problem, but I just wanted to mention it.
@johncordell8661
@johncordell8661 2 жыл бұрын
@@IAmTimCorey thank you! I appreciate the response!
@simamba899
@simamba899 10 ай бұрын
Thanks Tim, I really like your best practices. I am new using SignalR and I try to make an interaction in real time between two players in a game, and including chat too, but a have a doutb: can I use two hubs (one for the chat and other for the interaction multiplayer) or just one to achieve the result?.
@IAmTimCorey
@IAmTimCorey 10 ай бұрын
You could do either, but it is probably better to have one signal that transmits all of your data rather than two connections per client.
@simamba899
@simamba899 10 ай бұрын
Ok Tim, I will try it, thank you.
@_Szakal
@_Szakal Жыл бұрын
And how to keep messages and show them back whenever for new client is connected?
@MrNewSports
@MrNewSports Жыл бұрын
Hi, I have an application in .NET 6 : Console Server WPF Client I want replace Websocket by SignalR but how to self hosting the server in a standard console (or wpf) application ?
@cyrildouglas9262
@cyrildouglas9262 2 жыл бұрын
Thanks Tim for another great video, do you have any plans about MAUI? do we see anything about it from you anytime soon?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I do. I've been holding off until it gets closer to launch.
@cyrildouglas9262
@cyrildouglas9262 2 жыл бұрын
@@IAmTimCorey That would be great, thanks for your efforts.
@OFFendedAlastor
@OFFendedAlastor Жыл бұрын
Красавчик, тащер
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks, I think.
@davidhouser9280
@davidhouser9280 11 ай бұрын
I'm very interested in creating a chat program with a dedicated server and making it cross platform and I'm very willing to take the time and learn so any ideas help links or courses I would love to hear
@petropzqi
@petropzqi 2 жыл бұрын
Yéeeeeeeeees!
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
🎉🎉
@mikemurphy1824
@mikemurphy1824 Жыл бұрын
@IAmTimCorey I am trying to create the equivalent of the WPF client in a console app in regards to your SignalR videos but am stumbling over the dependency injection part in regards to SignalR. This is the error: "No constructor for type 'Microsoft.AspNetCore.SignalR.Client.HubConnection' can be instantiated using services from the service container and default values". Any help would be appreciated.
@broadshare
@broadshare 2 жыл бұрын
lol, I hate guids too. Great tutorial
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks!
@vaibhavgithub6094
@vaibhavgithub6094 11 ай бұрын
hey how do you make sure the authentication
@davidmtundi3400
@davidmtundi3400 Жыл бұрын
Hello Tim, thanks for this tutorial, am building a chat application using azureSignalR but the trouble comes when i want to go serverless so that i host the server on azure, how can i do that?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Azure has a SignalR service you can use.
@alessandrovangeli8395
@alessandrovangeli8395 Жыл бұрын
Tim, can a server push signalR to clients when on the server something happens? I mean which tipe of project would you use for serverside? and the clients only listen to the server. thanks
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yes, when a connection is open, the server can talk to the client or the client can talk to the server.
@orhancanoguz4423
@orhancanoguz4423 2 жыл бұрын
Hello Mr Corey, how can we add ( html5 , css3,js pages created on other editors) pages to BLAZOR projects as front end pages or integrate in Visual studio ?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@halskeins5362
@halskeins5362 Жыл бұрын
Tim, I can't thank you enough. Is there a video that shows us how to deploy SignalR?
@halskeins5362
@halskeins5362 Жыл бұрын
To non-azure?
@halskeins5362
@halskeins5362 Жыл бұрын
SSMS
@IAmTimCorey
@IAmTimCorey Жыл бұрын
No, there isn't.
@uppercat7268
@uppercat7268 2 жыл бұрын
But we could use insead of "hubConnection is not null" in the if-statement, the IsConnected property?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
No, because you can have a closed connection. That isn't the same thing as a null hubConnection.
@testerproject7873
@testerproject7873 Жыл бұрын
Do you know how to implement login authentication like whatapps web using blazor server and SignalR ? if yes, can you make a tutorial video about this thank you :)
@AkarumeiAkashi
@AkarumeiAkashi Жыл бұрын
How to make two desktop wpf apps communicate over the global network? What we should change?
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Either they need to be able to directly talk to each other or you need to have a web server act as the middle piece.
@andywalter7426
@andywalter7426 2 жыл бұрын
You mentioned in the video about doing a que. Can you show a sample of how a que would work. Because that can be helpful sometimes too where if there is a message but its not connected. Also, can you show how a person can do the following: there are 2 clients. It needs to send to one client that is not there. however, once that client gets connected, then send to that client. Is that possible?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I'll add that to my suggestion list. It is possible.
@dima9917
@dima9917 Жыл бұрын
Please do a tutorial about signalR with azure
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@michelchaghoury9629
@michelchaghoury9629 2 жыл бұрын
@IAmTimCorey i realljy like your virds and i learn a lot as an advanced spring boot / Java developer i want to make a transition to NET i do not want to skip steps and i do not need to start from scratch like understand oop concepts or web api or how to write good code but in the same time i want to learn stuff about NET and the best practicies what do you recommend me to do and where should i start
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I would recommend the C# Mastercourse ( www.iamtimcorey.com/p/c-mastercourse ). I know you don't need to start from scratch, but it will cover topics that you might otherwise miss at the earlier spots. It will cover a large swath of C#, plus when you purchase the course, you get three bonus courses. One, the Year of Coding, coaches you through the main course and adds additional practice (and solutions), quarterly evaluations of your progress, and expert advice. Another, the .NET Versions course, walks you through the changes to .NET over the past 20 years and what the implications of those changes are. The third, .NET Legacy, gives you the legacy .NET Framework training that has been replaced with .NET 6 training. That way, if you are working on a .NET Framework project, you still have access to the content that covers it.
@MrEcted
@MrEcted 2 жыл бұрын
Great video as always, but Is WPF even still relevant outside of maintaining legacy applications?
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Absolutely. It is the best desktop app choice Microsoft has. It deploys to the most Windows platforms and, if you use Uno, you can deploy it to Mac, Linux, iOS, Android, and the web.
@andywalter7426
@andywalter7426 2 жыл бұрын
I actually found that AutoReconnection usually did not work too great. I use signal r quite a bit and found most cases it would always fail to reconnect. In many of my situations (with tablets), it will disconnect and the only fix is a person has to turn off the wifi and turn it back on again. The solution I found that worked was having more complex code where if you get disconnected, then you have to manually go back in again. However, the code is smart enough to connect to the right places.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Trying to demo autoreconnect using a website that is being debugged by Visual Studio doesn't really work. You need an independent and external client to show that off. If you try it with the WPF client, though, it works great because the WPF client is totally independent.
@andywalter7426
@andywalter7426 2 жыл бұрын
@@IAmTimCorey The cases where autoreconnect did not work so well is in this case. The server was always opened. However, the client disconnected because they got disconnected from wifi. In that case, there was many times, it would fail to send message to server but the closed event never got called. In many cases a person is forced to manually turn off wifi and turn back on.
@Shazbot277
@Shazbot277 2 жыл бұрын
Error: "websocket connection to localhost failed....." on VS Community Edition v17.1.0 Solution: update to v17.1.6 and it fixed it. Thank Tim for the tutorial
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Interesting. Thanks for sharing.
@Mikarsoft
@Mikarsoft 2 жыл бұрын
Very nice tool and tutorial. Unfortunately You can't add its Server Side to a class Library and use it in a Clean Architecture.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
If the structure of your architecture is such that you cannot use SignalR, you need to rethink your structure. Your structure should work for you, not work against you.
@muralikrishnachowdarypolin5601
@muralikrishnachowdarypolin5601 2 жыл бұрын
Hi useful video I need some more information how to send messages to user to user like chat app with authentication i see so many tutorials but all are using clients.all this case messages send to all users
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
Thanks for the suggestion. Please add it to the list on the suggestion site so others can vote on it as well: suggestions.iamtimcorey.com/
@apo135
@apo135 Жыл бұрын
Thanks for the video, really helpful for my goal ;) But, as a beginner in web / dev I'm wondering if it's possible to host signalR Hub in IIS without having to launch the index page ? Do the same blazor server app, but do not open any webpage to start the Hub. i don'k know if its comprehensive. Thanks for help all ;)
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yes, you can host a SignalR service without it being a web app. Azure even provides something like that.
@apo135
@apo135 Жыл бұрын
@@IAmTimCorey thanks ;) I succeed using topshelf, I created a windows service (thanks to another video from this channel)
@dmitriibessonov1964
@dmitriibessonov1964 2 жыл бұрын
Hi Tim, probably such a question was already asked, but can you explain why you have got a duplicate message just at the end of the video, when you tested the manual reconnect. I faced the same problem and want to get an explanation. Probably it is wpf issue, because it's not reproducible in the console app, but anyway
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
I forgot to unsubscribe from the SendMessage event when the server disconnected. When it reconnected, I subscribed for a second time. Thus, the two messages (one from each subscription to the event).
@jacopocaira5199
@jacopocaira5199 Жыл бұрын
Hello! i have this problem: i have two applications, the first one is in MAUI (Android/iOS) and the second one is in WPF. I need to be able to send in real time a string from the mobile app to the WPF one and i was wondering if SignalR can help me. I can adapt your solution to implement this idea? Thanks. I already attempted to use a "normal" webserver with the classic libraries, but i have to many problems while using it.
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Directly? No, you can't do that. You need to go through a web server. The web server could host the SignalR server. The problem is that SignalR requires a constant connection. Just keep that in mind. It might be easier to send a message and process it right away on the other end.
@theredbaron28
@theredbaron28 2 жыл бұрын
will we have a signalR based on some UI framework like angular or react and have SignalR as a separate application.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
The SignalR server is going to be C#. However, the client can be just about anything (JavaScript, C#, Java, etc.)
@theredbaron28
@theredbaron28 2 жыл бұрын
@@IAmTimCorey Yes sir you are right, I was simply saying it would have been nice to have an approach which is mostly used in industry, the one you have given is also classic and quite amazing. If possible have a small tutorial for Signal R with react or Angular 🙂
@souravsingha3340
@souravsingha3340 2 жыл бұрын
If i want send massage specific client.example user from my database with identityframe work.
@IAmTimCorey
@IAmTimCorey 2 жыл бұрын
You can do that.
@souravsingha3340
@souravsingha3340 2 жыл бұрын
@@IAmTimCorey hope next part we seen that in action
@alexei6557
@alexei6557 Жыл бұрын
I can't create a WPF application ?!? Is there anything to install first on visual studio??
@IAmTimCorey
@IAmTimCorey Жыл бұрын
Yes, you need to install the Desktop project types if you want to use them (WPF is included in that set). You also need to be on Windows, since WPF relies on Windows dlls.
Intro to SignalR in C# Part 2 - Beyond Chat Applications
27:58
IAmTimCorey
Рет қаралды 26 М.
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 4,4 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 51 МЛН
Best father #shorts by Secret Vlog
00:18
Secret Vlog
Рет қаралды 21 МЛН
Dependency Injection in .NET Core (.NET 6)
1:00:32
IAmTimCorey
Рет қаралды 184 М.
Intro to In-Memory Caching in C#
33:56
IAmTimCorey
Рет қаралды 78 М.
Real-Time Revolution: SignalR in Action - Kevin Griffin - NDC London 2022
1:06:04
3 .NET "Best Practices" I Changed My Mind About
10:16
Nick Chapsas
Рет қаралды 101 М.
Real-time web applications with ASP.NET Core SignalR
29:44
Microsoft Developer
Рет қаралды 99 М.
WebSockets Crash Course - Handshake, Use-cases, Pros & Cons and more
47:33
Delegates in C# - A practical demonstration, including Action and Func
1:09:11
WHAT’S THAT?
00:27
Natan por Aí
Рет қаралды 4,4 МЛН