integrate C# public class inside application namespace

  integrate C# public class inside application namespace

  
Hello.

I am developing an extention, which needs a public class inside web application namespace.
How can it be done?

Thank you in advance.

BR,
Dmitry.
Hi Dmitry,

Well, you can have any namespace and classes you want inside your extension. So yes.
But depending on what you want it for it may or may not work, since extensions dll's are "lazy-loaded" into the applications as a needed basis. So your class may not be loaded when required.

Can you give some details on what integration you are trying to do, so we can try to help a bit more?

Regards,
João Rosado
João, thank you for your reply.

The key is that I need a public class inside my application, but not in the extension.
Here is an example:

I have an extansion, with a method Start, where I do the following:


connection = new HubConnection("http://"+System.Web.HttpContext.Current.Request.Url.Authority);
 hub = connection.CreateHubProxy("im");
connection.Start().Wait();

This is an initialization of SignalR hub. And This needs that the application I have on that URL had a public class 
Startup:

namespace MyWebApplication
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.MapSignalR();
        }
    }

When my extension creates proxy hub, it cannot find public Startup class.

Humm,

Me and a college did some tests of SignalR integration a couple months ago and managed to have the class inside the extension by setting some configurations properties from SignalR.
Let me search if I can find a sample for it.

Also, let me just note that had an issue that SignalR required the application pool in Integrated Mode.
Currently the Platform is only supported/certified in Classic Mode.


Regards,
João Rosado
It looks like that it could be implemented as windows service self hosting only... But it is not possible in my situation.
And I didn't found a way how to integrate this Startup  class into application namespace.

BR,
Dmitry.
I found the code we had done for it, but my college says that he gave up on getting it to work.

I'll give it another try and get back to you.