-
Notifications
You must be signed in to change notification settings - Fork 25.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues (with services.AddSignalR()) #6340
Comments
@Nickeron Would you be able to elaborate a bit more so I can understand what's not working? |
@Nickeron can you elaborate on how it doesn't work? I can't repo the problem and we've had many people report success. |
I had the same problem:
AddSignalR() isn't a method of services. FIX: You need to install .NET Core SDK 2.1.300-preview1 https://www.microsoft.com/net/download/dotnet-core/sdk-2.1.300-preview1 It should then work. I hope this helps. |
@ImageQC Thanks for reporting the solution. @rachelappel can you get this fixed Friday morning? |
Brand new project following your recipe exactly like it was the sainted Mary Berry's lemon drizzle cake ;-) |
@ImageQC Is it erroring, and if so, what is the error message? |
In my case installing .NET Core SDK 2.1.300-preview1 fixed the problem as reported above. However, the sample didn't work as reported #6358. The error message was Failed to start the connection. Error: Unable to initialize any of the available transports |
@ImageQC What results are you getting in the sample? - can you try the sample and see how that works? |
The source of the problem is the lack of control over package versions. I got the sample working at The packages are given below. However, God knows where signalr.js comes from as the authors didn't bother to put a version number in the file (a sackable offence in my day). I just copied it and the rest of the script folder into my SpikeWebApp. Perhaps, you could find out and post here. Is this code developed by Microsoft employees, or volunteers? |
@ImageQC What about the Getting Started sample? Are you having issues with that sample? |
If you talking about then, no - it doesn't work. The problem is that you haven't given enough information about the packages, or the information you have given is wrong. I suspect if you gave the information in my previous post and identified the source of the signalr.js then you sample would work. However, I haven't the time to do that work. I'm cancer researcher, not a Microsoft employee ;-) |
@ImageQC I've opened an issue asking for the version in the JS file. That's a good idea. |
@ImageQC The Get Started sample is RC2, so if you use preview bits it will error. The JS file is the latest and matches the server versions in that sample. |
Shame - pour encourager les autres as we say in Montreux (Switzerland), or |
I hope all this was helpful. |
I don't understand what "a shame to encourage others" has to do with this issue? |
Shouldn't the .csproj file be:
|
@Rick-Anderson That's what's in the sample. |
It uses the latest version from your NuGet source. I'm getting clarification from the product team on why they are using this approach. |
In case anyone else reads this issue, @ImageQC .csproj file is not the recommended approach. The sample has the correct markup. At this point in SignalR development you probably don't want to use a version number. You can lock the version number when it's RTM. |
You should be using ASP.NET Core 2.1 rc1. I wouldn't update the docs to show that as we don't talk abut explicit package references to for example, add MVC. If we do explain that AddMvc is in the Microsoft.AspNetCore.Mvc package then I'd be more receptive to a change like this. Maybe the SignalR guide needs to explain say "follow the migration guide to upgrade to ASP.NET Core 2.1" |
I wasted most of the day trying to get it to work with ASP.NET Core 2.1, but failed due to package version conflicts. The information given in your docs just isn't sufficient. You need to give the .CSPPROJ details, as I did above. I would be delighted if you could give the information needed for me to target Core 2.1, but I started at Core 2.0 on the basis that you need first get the project working and then make your changes. I hope others following your example find the info I provided useful. However, my advice would be to go to the Azure SignalR group. Their sample does work out of the box. Yours should do the same, yes? https://github.com/aspnet/AzureSignalR-samples/tree/master/samples/ChatRoomLocal |
@Rick-Anderson do we have an upgrade guide from 2.0 to 2.1?
The doc says in the very first paragraph:
Our samples need updating (which I will do right now): |
New doc: How to upgrade ASP.NET Core 2.0 to 2.1 #6404 |
You will note that I created a post about just that issue, even containing a link to the download. However, having done that and updated VS2017 to 15.7.1, the samples still didn't work. The problem seems to relate to package incompatibility. Eventually I found a set of packages that did work, but unfortunately only with .NET Core App 2.0. Therefore I posted my .CSPROJ to help anyone else who was struggling with this issue. I rather hoped that the owner and contributors (Microsoft staff?) would then post an update to the .CSPROJ with the required packages for .NET Core App 2.1. Unfortunately, that doesn't seem to have happened yet. Feedback: Modern software development is not much more than following recipes, so you need to make sure the recipes actually work. It would be very helpful the MS teams creating samples paid more attention to:
I hope everyone can learn from this. |
The samples are updated now. We'll do a better job at having those provided for the docs that show code. I agree without something runnable, it's hard to know what the exact steps are. |
All of that is done automatically with the template generated code. The templates use |
Glad to hear you found my feedback useful. If the samples are now working and you've detailed the packages people need to use then we can close this issue, yes? |
As well as specifying the package reference stated above I also had to change the target framework to 2.1 to get this demo project working i.e.
Hope that will help anyone else who found it frustrating getting this demo project working! |
services.AddSignalR(); does not work, and I could not figure out how to fix it.
using Microsoft (.AspNetCore) -> .AspNet .SignalR;
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: