How to apply signalR in nop.plugin

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
I have seen some topics(link1, link2 ) here about signalR. But those topics cant answer my question.
In signalR project they call configuration in startup class.
But how do I call it in my plugin.

public partial class Startup
    {
        public static void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }

I will be greatful if someone help me to do that.
8 years ago
Hi,
You should create a folder called App_Start in your plugin and add an OWIN class.

[assembly: OwinStartup(typeof(OwinStartup))]
namespace Your.Plugin.NameSpace
{
    public class OwinStartup
    {
        public void Configuration(IAppBuilder app)
        {
app.MapSignalR();
        }
    }
}


then you should set the owin app key in web.config to true

<add key="owin:AutomaticAppStartup" value="true" />


I think that should work. We did made it work sometimes back and I guess, it was this. Try this and let me know if this works.
8 years ago
Nope. It does not work.
8 years ago
It will work at nop.web if you all package from nuget.But it is difficult at Plugin.
8 years ago
I think the problem is with themes. If you put your scripts in your footer.cshtml file at the root Views folder, it works. Put it in the same place in the Themes folder - no go.
This has been a vexing problem for me (not as a plugin, however - that may require getting it to work, then created a stand-alone javascript file instead of the goofy auto-generated file)

It's a hair-puller, for sure. Good luck!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.