Tutorial C# Wpf Application Connected to ASPNET Core Signalr
HTML-код
- Опубликовано: 7 сен 2024
- In this tutorial, I show you how to connect a c# WPF application to an ASP .NET Web API with Signalr .NET Core.
Blog: discoverinvy.co...
Code:github.com/sta...
Keith, your tutorial was so much more straightforward than Microsoft's. Thank you!
Still delivers the point w/ ASP.NET Core 5.0
My projects don't need a web interface, yet most of their examples want you to make one. This was great
Well since clearly no one else is going to comment on this video, I will comment myself. Great video Keith, however you should do a little bit better job at explaining some things, everything you do in life can always be better. However I will promise I will not just view your videos and leave no comment even if I think it sucks.
Thanks Keith, I appreciate that so freaking much and I will work on those things I promise.
I've been working on updating a WPF app from a phone app for some time. I've been thru WCF, gRPC, Soap, Rest and finally to SignalR. I watched your video on SignalR which was very good. At the end of it you mentioned WPF. Needless to say this video is exactly what I've been in search of (for about a month)! Combining this video and your SignalR video should lead to a happy ending. Thanks.
If you need any help with anything at all I am open to any communication you like and all absolutely free of charge. I appreciate your support.
Thanks for the Video Keith, It really helped me with the basics.
You are welcome, I hope to add more soon.
Thanks a lot, Keith. This is exactly what I was looking for.
This is exactly what I'm looking for - thanks for sharing this!
Glad to be of help, I do plan on posting more in the near future, just been busy on a contract, however if you do need anything specific, be sure to let me know and I will try to help as best I can. Thank you!
Awesome Tutorial. Keep up the good work.
Thank you.
Thank you!
Very good video, It would be good to update it because there are some changes in libraries for NetCore that change some sentences for the routing and connection, but it is a very precise and good video, practical example
Great explanation, you solved my issue, was not able to make working .NET Core Backend (2.2 with visual studio 2017, as in your video) with a WPF Client (.NET Framework), simply due to the library used in the client which was "Microsoft.AspNet.SingnalR.Client" rahter than "Microsoft.AspNetCore.SingnalR.Client", this naming convention was a bit misleading for me, as the second one was intended only for .NET Core. Thanks
You can use both, I used it in the tutorial only as a use case, .net core is just as easy to set up, and I plan to release another video using all .net core. For wpf apps, the use of .net core is limited due to wpf not running on any other platform except with xamarin at the time. I am here to help any way I can.
Hey mate, great explanation. Could you upload a video on user specific notifications.
Great, thanks
I think yours is the only video that shows SignalR -> WPF connection
Thank you Ankit Nagpal, it is people like you who will get me to share more of my knowledge. I appreciate the sentiment.
@@keithwilson4284 My project has requirement to send real-time information from ASP.NET server to WPF Windows software and a Xamarin mobile app. I was exploring WCF and long polling, I guess SignalR is the way to go in my case?
@@i_fuk_religion Absolutely, signalr sounds defiantly like what you need. Even though WCF was a great technology, however we only really use it now to connect applications on the same network, I have seen signalr used with WCF and understand they are different technologies. For internet and cloud solutions, we use REST and Signalr. Other technologies equivalent to Signalr is Firebase, Pusher, RabbitMQ, WebRTC, MQTT and SOCKET.IO.
Cool Thanks :)
Hi, Keith, Great tutorial and subscribed. I clicked the button "Connect", it showed that a message of "An error occurred when sending your request." in ListBox, and NOT connected without any error. it seems hubconnection fails. Any way to fix it? Tks, JC
I apologize Ji Ch, this tutorial is outdated and have not had the time to update it. I should probably take it down.
well thats what im looking for.. where are the other parts? Thanks nice video!
What other parts are you referring too, I would like to help if I can.
@@keithwilson4284i thought it was just the intro into the whole signalR setup you did! :D
Thanks for posting this video, Keith. You are right about the dearth of SignalR videos for WPF. I followed along and have a slew of errors:
WpfApp1:MainWindow.xaml.cs: 'HubConnectionBuilder' does not contain a definition of 'WithURL'...
SignalRTestServer:Startup.cs: The name 'Signalapp' does not exist in the current context
SignalRTestServer:ValuesController.cs: The type or namespace name 'SignalrServer' could not be found:
SignalRTestServer:ValuesController.cs: The type or namespace name 'TestHub' could not be found:
SignalRTestServer:ValuesController.cs: The type or namespace name 'TestHub' could not be found:
How can I fix these? I looked at my using statements and I don't see any difference between mine and yours.
I will check it out for you when I get some time. Thanks
Try this link to help you out. github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/signalr
Hello, Keith.
Very intresting tutorial.
I am new to server stuff. Could you please clarify how to run "Postman"?
You use it at the end of the video.
Thank you Roman Kolychev, you can download postman from getpostman.com. I use the desktop version, however they do have an online version also. I use postman for all my api development, it allows you to send requests to your api's without creating a client side application or writing a lot of test code. If you have any more questions, feel free to shoot them my way, or let me know what you would like to see in a tutorial. I have been meaning to record more tutorials, and hopefully I will get better. I have seen where I have made a lot of mistakes. I too am always learning new things. Thanks again!
@@keithwilson4284 Thank you for reply. I i want kind of framework to comunicate between server app and client apps and thought SignalR should help me.
@@DeMoZyou signalr will do just that. You need any help just let me know.
@@keithwilson4284 if you make the video about sending messages between server and client aps using SignalR , that would be awesome!
Hey Keith. great video. Question, have you tried connecting your WPF app to Azure SingalR service?
No, I have not tried it.
@@keithwilson4284 Cool thanks for the quick reply :-)
Hi Keith. I'm following your explanation to make something similar in a .NET wpf application. But one thing that i don't understand, and maybe you can explain is... Why do i have to use the nuget package for .net Core, and not the one for .net framework to be able to initialize the variable _connection with a HubConnectionBuilder()? I'm not able to do it with the .net framework nuget package.
The asp.net uses .net core, .net signalr and .net core signalr are not compatible. You are better off going with .net core for both server and client, however in this tutorial I wanted to show that it is possible to use .net core libraries in a standard .net application.
If you need any additional help on set up, just shoot me an email wilsonk70@gmail.com. I am currently working on a large project that seems to keep getting larger, but I will help out the best I can. I plan to do more tutorials in the near future as soon as I finish with this client.
Can you create an example of sending a message from the application instead of using Postman?
What language would you like it in? If it isn't in C# it could be in Java script.
hey man, for the client, why did you use the wpf .net framework instead of wpf .net core one?
You can use .net core, but at the time of this recording I was still developing in .net framework.
it says ... Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing. To continue using 'UseMvc', please set 'MvcOptions.EnableEndpointRouting = false' inside 'ConfigureServices'.
Flow Wolf, thanks a million for that. I really appreciate your contribution. I am on contract currently, but if I can help in any way, just shoot me an email or continue on here.
Create video! Thanks for that.
This works locally fine. Unfortunately when publishing the API on IIS the WPF App doesn't get hit. Any idea? I also don't get any exception...
Daniel I will check that out for you. If you need help working it out, I will be more than happy. Thanks for the reply.
Daniel email me at wilsonk70@gmail.com so we can figure this out, I am not seeing the same you are apparently
Hi Keith, could you please share the source code ?
I will after I make some changes, because since this video there has been updates that make this one not work.