Load() public méthode

Executes the loader, searching for the entry point by name.
public Load ( string startupName ) : Action
startupName string The name of the assembly and type entry point
Résultat Action
Exemple #1
0
        private IntegratedPipelineBlueprint InitializeBlueprint()
        {
            IntegratedPipelineBlueprintStage firstStage = null;

            string appStartup = ConfigurationManager.AppSettings[Constants.OwinAppStartup];
            var loader = new DefaultLoader();
            Action<IAppBuilder> startup = loader.Load(appStartup ?? string.Empty);
            if (startup == null)
            {
                return null;
            }

            var appContext = OwinBuilder.Build(builder =>
            {
                EnableIntegratedPipeline(builder, stage => firstStage = stage);
                startup.Invoke(builder);
            });

            if (appContext == null)
            {
                return null;
            }

            string basePath = Utils.NormalizePath(HttpRuntime.AppDomainAppVirtualPath);

            return new IntegratedPipelineBlueprint(appContext, firstStage, basePath);
        }
Exemple #2
0
 internal static OwinAppContext Build()
 {
     string appStartup = ConfigurationManager.AppSettings[Constants.OwinAppStartup];
     var loader = new DefaultLoader();
     Action<IAppBuilder> startup = loader.Load(appStartup ?? string.Empty);
     return Build(startup);
 }
Exemple #3
0
        public static AppDelegate DefaultFactory()
        {
            var loader = new DefaultLoader();
            var builder = new AppBuilder();

            var startupName = ConfigurationManager.AppSettings["owin:Startup"];
            var startupMethod = loader.Load(startupName);
            if (startupMethod != null)
            {
                startupMethod.Invoke(builder);
            }
            return (AppDelegate)builder.Build(typeof(AppDelegate));
        }
Exemple #4
0
        internal static Action<IAppBuilder> GetAppStartup()
        {
            string appStartup = ConfigurationManager.AppSettings[Constants.OwinAppStartup];

            var loader = new DefaultLoader(new ReferencedAssembliesWrapper());
            IList<string> errors = new List<string>();
            Action<IAppBuilder> startup = loader.Load(appStartup ?? string.Empty, errors);

            if (startup == null)
            {
                throw new EntryPointNotFoundException(Resources.Exception_AppLoderFailure
                    + Environment.NewLine + " - " + string.Join(Environment.NewLine + " - ", errors)
                    + (IsAutomaticAppStartupEnabled ? Environment.NewLine + Resources.Exception_HowToDisableAutoAppStartup : string.Empty)
                    + Environment.NewLine + Resources.Exception_HowToSpecifyAppStartup);
            }
            return startup;
        }