locked
SignalR for AspNet MVC server RRS feed

  • Question

  • User390711441 posted

    Hello.

    I try to use SignalR library instead of System.Net.Websockets. I found next repositories:

    https://github.com/aspnet/SignalR

    https://github.com/SignalR/SignalR

    What is the difference between these libraries?

    NuGet contains a package for second repo and I can't use it because of the error:

    Error    CS1929    'IApplicationBuilder' does not contain a definition for 'MapSignalR' and the best extension method overload 'OwinExtensions.MapSignalR(IAppBuilder)' requires a receiver of type 'IAppBuilder'

    Monday, September 4, 2017 10:09 AM

Answers

All replies

  • User-335504541 posted

    Hi Pizhon,

    https://github.com/aspnet/SignalR

    It's for asp.net core.

    https://github.com/SignalR/SignalR

    It's for asp.net.

    Error    CS1929    'IApplicationBuilder' does not contain a definition for 'MapSignalR' and the best extension method overload 'OwinExtensions.MapSignalR(IAppBuilder)' requires a receiver of type 'IAppBuilder'

    Could you show me your code? It seems you need to use IAppBuilder.

    For example:

    using Owin;
    
    namespace Microsoft.AspNet.SignalR.StockTicker
    {
        public static class Startup
        {
            public static void ConfigureSignalR(IAppBuilder app)
            {           
                 app.MapSignalR();
            }
        }
    }

    Best Regards,

    Billy

    Tuesday, September 5, 2017 6:48 AM
  • User390711441 posted

    Some code from working project:

    using Owin;

    namespace SomeNamespace
    {
        public partial class Startup
        {
            public Startup(IHostingEnvironment env)
            {
                // Some code
            }

            public void ConfigureServices(IServiceCollection services)
            {
                // Some code
            }

            public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
            {
                // Compilation error: 'IApplicationBuilder' does not contain a definition for 'MapSignalR' and the best extension method overload 'OwinExtensions.MapSignalR(IAppBuilder)' requires a receiver of type 'IAppBuilder'
                app.MapSignalR();
            }
            
            // Is not called
            public static void ConfigureSignalR( IAppBuilder app )
            {
                app.MapSignalR();
            }

            // Is not called
            public void ConfigureSignalR2( IAppBuilder app )
            {
                app.MapSignalR();
            }
        }
    }

    Wednesday, September 6, 2017 12:54 PM
  • User-335504541 posted

    Hi Pizhon,

    According to the error message, please try to change IApplicationBuilder to IAppBuilder.

    For example:

            public static void Configure(IAppBuilder app, HostingEnvironment env, ILoggerFactory loggerFactory)
            {
                 app.MapSignalR();
            }

    Best Regards,

    Billy
               

    Thursday, September 7, 2017 1:22 AM
  • User390711441 posted

    Unfortunately I can't do it. This method contains code which use `IApplicationBuilder` and I get other compilation errors like

    'IAppBuilder' does not contain a definition for ...

    Any plans for publishing https://github.com/aspnet/SignalR as NuGet package?

    Thursday, September 7, 2017 6:05 AM
  • User-335504541 posted

    Hi Pizhon,

    Any plans for publishing https://github.com/aspnet/SignalR as NuGet package?

    That project is part of ASP.NET Core.

    You could get it by installing .net core:

    https://docs.microsoft.com/en-us/aspnet/core/getting-started

    Best Regards,

    Billy

    Friday, September 8, 2017 8:39 AM
  • User390711441 posted

    I found this page: https://docs.microsoft.com/en-us/aspnet/core/choose-aspnet-framework

    Looks like AspNet Core doesn't support SignalR and I already have installed .net core but I can't find signalr namespace into `Microsoft.AspNetCore`.

    Friday, September 8, 2017 10:57 AM
  • User-335504541 posted

    Hi Pizhon,

    Please try :

    Install-Package Gray.Microsoft.AspNetCore.SignalR.Server -Version 0.2.0-alpha1

    https://www.nuget.org/packages/Gray.Microsoft.AspNetCore.SignalR.Server/

    Best Regards,

    Billy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 13, 2017 8:45 AM
  • User390711441 posted

    Thanks for the advice!

    I'll try it.

    If I find errors, I'll create a separate post.

    Wednesday, September 13, 2017 11:39 AM
  • User-335504541 posted

    Hi Pizhon,

    I have found a sample for signalR in Asp.net core:

    https://github.com/aspnet/SignalR/tree/dev/samples/ChatSample

    https://github.com/aspnet/SignalR/issues/814

    Please take a look.

    Best Regards,

    Billy

    Thursday, September 14, 2017 1:55 AM