asp.netsensenet

Where is the Startup class?


I'm trying to get started with Sensenet.

I followed this tutorial for installing Sensenet

Then I followed this tutorial for installing WebPages, so I can have the Sensenet user interface.

In the second tutorial for installing WebPages under Web App Changes, I don't know where I can configure SignalR, as I don't have any "Startup" class or "Configure" function.

Where do I get the "IAppBuilder" and where should I add "app.MapSignalR();"?


Solution

  • That part is optional, you'll need it only if you want to see features that actually use SignalR - currently this is the Task Monitor user interface.

    The Startup class is there only if you have (or selected) some kind of authentication, when creating the project. And it can be added later too, so you do not have to worry about this.

    If you do not have a Startup class but want to use the task monitor page (or any SignalR-related feature really), you can simply add a new Startup.cs to your project with the following contents (you should replace the namespace of course with your own):

    using Microsoft.Owin;
    using Owin;
    
    [assembly: OwinStartupAttribute(typeof(SnWebApplication.Startup))]
    namespace SnWebApplication
    {
        public partial class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                app.MapSignalR();
            }
        }
    }
    

    The code above will initialize SignalR when the application starts.

    Please note that if you do have an existing Startup class, you should only add the MapSignalR call, do not remove any existing config calls.