/// <summary> /// Start application and initialize all needed systems /// </summary> protected void Application_Start() { // Create scripting language = new IronPythonLanguage(); host = new DlrHost<IronPythonLanguage>(language); host.AddImportResolver(new NoImporter()); // Search paths Host.AddSearchPath(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath); // Load app.py and execute var source = Host.ScriptEngine.CreateScriptSourceFromString ( System.IO.File.ReadAllText(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "app.py") ); source.Execute(Host.DefaultScope.ScriptScope); app = (AspNetMvcAPI.Application)Host.DefaultScope.CreateClassInstance("App").Instance; // Call start app.start(); }
/// <summary> /// Start application and initialize all needed systems /// </summary> protected void Application_Start() { // Create scripting language = new IronPythonLanguage(); host = new DlrHost <IronPythonLanguage>(language); host.AddImportResolver(new NoImporter()); // Search paths Host.AddSearchPath(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath); // Load app.py and execute var source = Host.ScriptEngine.CreateScriptSourceFromString ( System.IO.File.ReadAllText(System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath + "app.py") ); source.Execute(Host.DefaultScope.ScriptScope); app = (AspNetMvcAPI.Application)Host.DefaultScope.CreateClassInstance("App").Instance; // Call start app.start(); }