Question

i just want to set up ChatJs with asp.net 4.0. i read all steps that provided with it's documentation. but i can't install to my application.

here my web application built with 4.0 framework. so may be this chatjs support greater version with 4.5. Is there any body know how i install this chat application with asp.net 4.0 with sql server 2008. i successfully set up all basic files like chatjs and signalR to my web app but here at startup.cs file gives some compile time error.

here is my startup.cs file code :

using ChatJs.Admin;
using Microsoft.Owin;
using Owin;
[assembly: OwinStartup(typeof(Startup))]
namespace ChatJs.Admin
{
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            this.ConfigureAuth(app);
            app.MapSignalR();
        }
    }
}

here is my compile time errors:

Error   1   'ChatJs.Admin.Startup' does not contain a definition for 'ConfigureAuth' and no extension method 'ConfigureAuth' accepting a first argument of type 'ChatJs.Admin.Startup' could be found (are you missing a using directive or an assembly reference?) F:\EasyWeb\App_Code\Startup.cs  11  18  F:\EasyWeb\

Error   2   'Owin.IAppBuilder' does not contain a definition for 'MapSignalR' and no extension method 'MapSignalR' accepting a first argument of type 'Owin.IAppBuilder' could be found (are you missing a using directive or an assembly reference?)   F:\EasyWeb\App_Code\Startup.cs  12  17  F:\EasyWeb\

please help me..

Was it helpful?

Solution

About the absense of the ConfigureAuth method:

You are refering to this call:

https://github.com/ChatJS/ChatJs-Demo/blob/master/ChatJs.Admin/Startup.cs#L17

The reason why it's apparently missing is because Microsoft determined that the best place to put all the ASP.NET startup code is in the App_Start folder, so there's a partial class for Startup there. The ConfigureAuth method is here:

https://github.com/ChatJS/ChatJs-Demo/blob/master/ChatJs.Admin/App_Start/Startup.Auth.cs#L11

About the absense of the MapSignalR method:

The MapSignalR method is defined in the class OwinExtensions from the Microsoft.AspNet.SignalR.Core assembly. This is specific to SignalR and it will only run on .NET 4.5.

Running ChatJS 2.0 in the .NET Framework 4.0

ChatJS 2.0 will run on .NET 4.0, but only if you reference SignalR 1 instead of 2. There's no reason why ChatJS uses SignalR 2 appart from it being the latest version. Please notice that Microsoft changed the way SignalR is initialized from version 1 to 2 so the SignalR part of the tutorial won't apply.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top