locked
Running more "owin:AppStartup" together RRS feed

  • Question

  • User-1392776802 posted

    Hi there,

    I have some CMS add-on which uses OWIN. Also this web app uses OWIN for other purposes.

    Basically I need to add

    <add key="owin:appStartup" value="XYZ" />

    for both of them. Since add-on is black box for me I could not omit its initialization with OWIN.

    How should I fix this technically?

    Wednesday, May 2, 2018 1:32 PM

Answers

  • User753101303 posted

    Hi,

    AFAIK you can configure multiple classes but only one will be called. Try perhaps https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-startup-class-detection for details.

    If this is really an "add-on", I would expect that the documentation for this CMS tells how it could be integrated inside an application. Or is it rather intended for running just on its own web site ? (might be also easier to handle further updates ?).

    At worst the doc should allow to find the Startup class for this application and then you could call into it from your own Startup class maybe? Still wondering about this CMS being an "add-on" though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2018 2:04 PM

All replies

  • User753101303 posted

    Hi,

    AFAIK you can configure multiple classes but only one will be called. Try perhaps https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-startup-class-detection for details.

    If this is really an "add-on", I would expect that the documentation for this CMS tells how it could be integrated inside an application. Or is it rather intended for running just on its own web site ? (might be also easier to handle further updates ?).

    At worst the doc should allow to find the Startup class for this application and then you could call into it from your own Startup class maybe? Still wondering about this CMS being an "add-on" though.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2018 2:04 PM
  • User-1392776802 posted

    I know the same. I checked some documentation before asking. It seems odd to me also. I asked already CMS vendor about this.

    Yes, it is definitely add-on for CMS. There is example for 2 add-ons but it does not say how to implement them both at once.

    Unfortunately, if I am about to call start up from my code I would have to reflect all assemblies of vendor until I found the responsible class (if there is expected implementation).

    Wednesday, May 2, 2018 3:02 PM
  • User753101303 posted

    if there is expected implementation

    To start with are you sure this is the problem you have? With a real "add-on" system I would rather expect each add-on to expose required methods and have them being called automatically by the hosting CMS application (rather than having each "add-on" to expose directly an Owin Startup class).

    It will be likekly easier to reach someone else having used multiple add-ons in the support forum for this CMS system rather than here (and for now we don't know which CMS you are using).

    Wednesday, May 2, 2018 3:20 PM
  • User475983607 posted

    The OWIN Startup attribute is used to bootstrap OWIN components.  You'll need to contact support for the CMS product you are using if you are not sure how to configure the two add-ins.   I assume the two add-ins can be used together?

    If you create an a new MVC project and select the  "Individual Account" option, the template will show how the Identity APIs and authentication cookie are configured by calling into ConfigureAuth() which are two different frameworks. 

    [assembly: OwinStartupAttribute(typeof(MvcIdentityDemo.Startup))]
    namespace MvcIdentityDemo
    {
        public partial class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                ConfigureAuth(app);
            }
        }
    }
    

    I don't see why this concept will not work for the CMS if the add-ins are OWIN enabled.

    Wednesday, May 2, 2018 3:30 PM
  • User-1392776802 posted

    The OWIN Startup attribute is used to bootstrap OWIN components…


    Ah, thanks that’s good hint.

    Wednesday, May 2, 2018 3:40 PM
  • User-1392776802 posted

    To start with are you sure this is the problem you have? With a real "add-on"…

    I shall continue with vendor. I was just about to verify if there is no workaround to use owin:appStartup multiple times.

    Wednesday, May 2, 2018 3:42 PM