Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MVC4
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
 
namespace Chatapp
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode,
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            RouteTable.Routes.MapHubs();
            AreaRegistration.RegisterAllAreas();
 
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }
    }
}
 

 

 

 

 

////I got the error RouteTable.Routes.MapHubs(); this line How to rectify this error please help me....
Posted 21-Feb-14 4:22am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can refer the following link to broadcast the message to clients using the MVC 5:
 
SignalR Use in MVC 5
  Permalink  
Comments
ilaya muthumanickam at 26-Feb-14 0:30am
   
Thanks for your reply this link is very helpful for me.......
Nimit Joshi at 26-Feb-14 0:32am
   
Its my pleasure..Please vote the answer and if that article helps you that add a comment there
ilaya muthumanickam at 26-Feb-14 0:45am
   
Error 1 'System.Web.Routing.SignalRRouteExtensions.MapHubs(System.Web.Routing.RouteCollection)' is obsolete: 'Use IAppBuilder.MapSignalR in an Owin Startup class. See http://go.microsoft.com/fwlink/?LinkId=320578 for more details.' E:\Modules\Chatapp\Global.asax.cs 22 13 Chatapp
ilaya muthumanickam at 26-Feb-14 0:46am
   
The above error is comming repetedly...
Nimit Joshi at 26-Feb-14 0:54am
   
Check your Global.asax file that the MapHub() is routed or not?
ilaya muthumanickam at 26-Feb-14 1:54am
   
i can't able to understand your question actually i have add a single line in global.asax
RouteTable.Routes.MapHubs();this line
Nimit Joshi at 26-Feb-14 3:37am
   
do you have added a Startup class? if not then
 
using Microsoft.Owin;
using Owin;
using SignalRWebApp;
 
[assembly: OwinStartup(typeof(SignalRWebApp.Startup))]
namespace SignalRWebApp
{
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
}
Sarveshwar Mabrukhane at 3-Jun-14 6:45am
   
My chat application not working although their are not any error. chat messages are not sent.
Member 10921075 at 3-Jul-14 3:32am
   
same problem here. i'm having the same error
"Error 1 'System.Web.Routing.SignalRRouteExtensions.MapHubs(System.Web.Routing.RouteCollection)' is obsolete: 'Use IAppBuilder.MapSignalR in an Owin Startup class. See http://go.microsoft.com/fwlink/?LinkId=320578 for more details.'
vaibhavg1985apr at 2-Oct-14 14:39pm
   
I have added StartUp class. Still i am getting same error. Could you please let me know if something else is required?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 26 Feb 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100