From 80c9a39c52b283570beeee3a1e6c0af7233f302f Mon Sep 17 00:00:00 2001 From: Schwirg László Date: Thu, 27 Apr 2023 19:18:03 +0200 Subject: [PATCH] - Hangfire segítségével megoldásra került, hogy az ütemezett riportokat a web alkalmazás futtatja, tehát nem kell a service hozzá; - ez a funkció az xml paraméterek között ki/be kapcsolható; - értelemszerűen, ha ki van kapcsolva, akkor a szervizt kell a megfelelő módon használni! - a webalkalmazás automatikus indítása és folyamatos futtatása is beépítésre került --- Vrh.Web.Reporting/Global.asax.cs | 206 +++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Vrh.Web.Reporting/HangfireBootstrapper.cs | 217 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Vrh.Web.Reporting/Vrh.Web.Reporting.csproj | 1 + 3 files changed, 225 insertions(+), 199 deletions(-) create mode 100644 Vrh.Web.Reporting/HangfireBootstrapper.cs diff --git a/Vrh.Web.Reporting/Global.asax.cs b/Vrh.Web.Reporting/Global.asax.cs index b4c66cf..9ee6e16 100644 --- a/Vrh.Web.Reporting/Global.asax.cs +++ b/Vrh.Web.Reporting/Global.asax.cs @@ -15,14 +15,16 @@ using Hangfire; using Microsoft.Web.Administration; using Vrh.iScheduler; using Vrh.Logger; - +using Vrh.Web.HangfireBootstrapperNS; namespace Vrh.Web.Reporting { public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { - (new DCLogEntry(LogLevel.Information, "Vrh.Web.Reporting.MvcApplication.Application_Start")).Write(); + var methodfullname = $"{typeof(HangfireBootstrapper).FullName}.{System.Reflection.MethodBase.GetCurrentMethod().Name}"; + + (new DCLogEntry(LogLevel.Information, methodfullname)).Write(); AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); @@ -51,7 +53,7 @@ namespace Vrh.Web.Reporting /// Here NameOfTheAssemblyContainingTheAutostartProviderClass is the name of (for example the dll), but without the extension. ////////////////////////////////////////////////////////////////////////////////////// - (new ApplicationPreload())._Preload(); + (new HangfireBootstrapper()).Initialize(); //Vrh.Web.Menu inicializáló beállításai Vrh.Web.Menu.Global.CustomerLogo = "~/Content/Images/Menu_LearLogo.jpg"; @@ -63,7 +65,8 @@ namespace Vrh.Web.Reporting protected void Application_End(object sender, EventArgs e) { - (new DCLogEntry(LogLevel.Information, "Vrh.Web.Reporting.MvcApplication.Application_End")).Write(); + var methodfullname = $"{typeof(HangfireBootstrapper).FullName}.{System.Reflection.MethodBase.GetCurrentMethod().Name}"; + (new DCLogEntry(LogLevel.Information, methodfullname)).Write(); HangfireBootstrapper.Instance.Stop(); } /// @@ -77,199 +80,4 @@ namespace Vrh.Web.Reporting //int i = 1; } } - public class ApplicationPreload : System.Web.Hosting.IProcessHostPreloadClient - { - public void Preload(string[] parameters) - { - (new DCLogEntry(LogLevel.Information, "Vrh.Web.Reporting.ApplicationPreload")).Write(); - _Preload(); - } - public void _Preload() - { - SetupAutoStart(typeof(ApplicationPreload)); - HangfireBootstrapper.Instance.SqlDBconnectionstring = Vrh.XmlProcessing.ConnectionStringStore.GetSQL(HANGFIRESQLDBCONNECTIONSTRINGNAME); - HangfireBootstrapper.Instance.Start(); - Vrh.iScheduler.Monitor.InitHangfire(HangfireBootstrapper.Instance._backgroundJobServer); - } - - public const string HANGFIRESQLDBCONNECTIONSTRINGNAME = "MAINDBLOG4PRO"; - public const string CONFIGFILEDIRECTORY = @"inetsrv\config"; - public const string CONFIGFILENAME = @"applicationHost.config"; - //public const string FILEPATH = @"C:\temp\applicationHost.config"; - public const string POOLNAME = "Log4ProIS_REPORTING"; - public const string WEBAPPNAME = "/Log4ProIS-REPORTING"; - public const string WEBSITENAME = "Default Web Site"; - public const string AUTOSTARTPROVIDERNAME = "ApplicationPreload"; - public const string AUTOSTARTPROVIDERTYPENAME = "Vrh.Web.Reporting.ApplicationPreload"; - public const string AUTOSTARTPROVIDERASSEMBLYNAME = "Vrh.Web.Reporting"; - - public static bool SetupAutoStart(Type serviceAutoStartProviderType) - { - const string SYSTEMAPPLICATIONHOST_ELEMENT = "system.applicationHost"; - const string APPLICATIONPOOLS_ELEMENT = "applicationPools"; - const string SITES_ELEMENT = "sites"; - const string SERVICEAUTOSTARTPROVIDERS_ELEMENT = "serviceAutoStartProviders"; - const string SITE_ELEMENT = "site"; - const string APPLICATION_ELEMENT = "application"; - const string ADD_ELEMENT = "add"; - const string NAME_ATTRIBUTE = "name"; - const string TYPE_ATTRIBUTE = "type"; - const string SERVICEAUTOSTARTENABLED_ATTRIBUTE = "serviceAutoStartEnabled"; - const string SERVICEAUTOSTARTPROVIDER_ATTRIBUTE = "serviceAutoStartProvider"; - const string APPLICATIONPOOL_ATTRIBUTE = "applicationPool"; - const string PATH_ATTRIBUTE = "path"; - const string AUTOSTART_ATTRIBUTE = "autoStart"; - const string STARTMODE_ATTRIBUTE = "startMode"; - - string applicationpoolname = GetCurrentApplicationPoolName(); - string websitename = System.Web.Hosting.HostingEnvironment.SiteName; - string webapplicationname = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath; - string autostartprovidername = (websitename + "____" + applicationpoolname + "____" + webapplicationname).Replace(" ", "_").Replace("-", "_").Replace("/", "_"); - string serviceAutoStartProviderTypeFullName = serviceAutoStartProviderType.FullName; - string serviceAutoStartProviderAssassemblyName = serviceAutoStartProviderType.Assembly.GetName().Name; - var le = new DCLogEntry(LogLevel.Information, "Vrh.Web.Reporting.MvcApplication.SetupAutoStart"); - try - { - string configfilepath = Path.Combine(NativeSystemPath, CONFIGFILEDIRECTORY, CONFIGFILENAME); - le.AddDataField("configfilepath", configfilepath); - le.AddDataField("applicationpoolname", applicationpoolname); - le.AddDataField("websitename", websitename); - le.AddDataField("webapplicationname", webapplicationname); - le.AddDataField("serviceAutoStartProviderTypeFullName", serviceAutoStartProviderTypeFullName); - le.AddDataField("serviceAutoStartProviderAssassemblyName", serviceAutoStartProviderAssassemblyName); - - - var filecontent = System.IO.File.ReadAllText(configfilepath); - XElement configxml = XElement.Parse(filecontent, LoadOptions.PreserveWhitespace); //XElement.Load(configfilepath); - - XElement myconfigrootxml = configxml.Element(XName.Get(SYSTEMAPPLICATIONHOST_ELEMENT)); - XElement myapplicationpooladdelement = myconfigrootxml?.Element(XName.Get(APPLICATIONPOOLS_ELEMENT))? - .Elements(XName.Get(ADD_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(NAME_ATTRIBUTE)).Value == applicationpoolname); - XElement mysiteapplicationelement = myconfigrootxml?.Element(XName.Get(SITES_ELEMENT))? - .Elements(XName.Get(SITE_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(NAME_ATTRIBUTE)).Value == websitename) - .Elements(XName.Get(APPLICATION_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(PATH_ATTRIBUTE)).Value == webapplicationname && e.Attribute(XName.Get(APPLICATIONPOOL_ATTRIBUTE)).Value == applicationpoolname); - if (myapplicationpooladdelement == null) return false; - if (mysiteapplicationelement == null) return false; - - bool configchanged = false; - configchanged = SetOrAddAttribute(AUTOSTART_ATTRIBUTE, myapplicationpooladdelement, "true") || configchanged; - configchanged = SetOrAddAttribute(STARTMODE_ATTRIBUTE, myapplicationpooladdelement, "AlwaysRunning") || configchanged; - configchanged = SetOrAddAttribute(SERVICEAUTOSTARTENABLED_ATTRIBUTE, mysiteapplicationelement, "true") || configchanged; - configchanged = SetOrAddAttribute(SERVICEAUTOSTARTPROVIDER_ATTRIBUTE, mysiteapplicationelement, autostartprovidername) || configchanged; - - XElement myautostartproviderselement = null; - XElement myautostartprovideraddelement = null; - configchanged = SetOrAddElement(SERVICEAUTOSTARTPROVIDERS_ELEMENT, myconfigrootxml, "", out myautostartproviderselement) || configchanged; - configchanged = SetOrAddElementWithSelectorAttribute(ADD_ELEMENT, myautostartproviderselement, NAME_ATTRIBUTE, autostartprovidername, "", out myautostartprovideraddelement) || configchanged; - configchanged = SetOrAddAttribute(TYPE_ATTRIBUTE, myautostartprovideraddelement, $"{serviceAutoStartProviderTypeFullName},{serviceAutoStartProviderAssassemblyName }") || configchanged; - - if (configchanged) - { - //configxml.Save(configfilepath); - System.IO.File.WriteAllText(configfilepath, configxml.ToString()); - } - le.AddDataField("configchanged", configchanged); - //le.AddDataField("myconfigrootxml", myconfigrootxml); - le.AddSuccessResult("SUCCESS"); - return true; - } - catch (Exception ex) { le.AddExceptionResult(ex); le.SetLogLevel(LogLevel.Error); return false; } - finally { le.Write(); } - } - private static bool SetOrAddElement(string elementname, XElement elementcontainer, string elementvalue, out XElement myelement) - { - bool configchanged = false; - myelement = elementcontainer?.Element(XName.Get(elementname)); - if (myelement == null) { myelement = new XElement(XName.Get(elementname), ""); elementcontainer.Add(myelement); configchanged = true; } - if (myelement.Value != elementvalue) { myelement.Value = elementvalue; configchanged = true; } - return configchanged; - } - private static bool SetOrAddElementWithSelectorAttribute(string elementname, XElement elementcontainer, string selectorattributename, string selectorattributevalue, string elementvalue, out XElement myelement) - { - bool configchanged = false; - myelement = elementcontainer?.Elements(XName.Get(elementname))?.FirstOrDefault(e => e.Attribute(XName.Get(selectorattributename)).Value == selectorattributevalue); - if (myelement == null) - { - myelement = new XElement(XName.Get(elementname), ""); - elementcontainer.Add(myelement); - SetOrAddAttribute(selectorattributename, myelement, selectorattributevalue); - configchanged = true; - } - if (myelement.Value != elementvalue) { myelement.Value = elementvalue; configchanged = true; } - return configchanged; - } - private static bool SetOrAddAttribute(string attrname, XElement attrcontainer, string attrvalue) - { - bool configchanged = false; - XAttribute attr = attrcontainer.Attribute(XName.Get(attrname)); - if (attr == null) { attr = new XAttribute(XName.Get(attrname), ""); attrcontainer.Add(attr); configchanged = true; } - if (attr.Value != attrvalue) { attr.Value = attrvalue; configchanged = true; } - return configchanged; - } - public static string NativeSystemPath - { - get - { - if (Environment.Is64BitOperatingSystem) - { - return System.IO.Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.Windows), - "Sysnative"); - } - return Environment.GetFolderPath(Environment.SpecialFolder.System); - } - } - - public static string GetCurrentApplicationPoolName() - { - string appPoolName = string.Empty; - foreach (Application app in (new ServerManager()).Sites[System.Web.Hosting.HostingEnvironment.ApplicationHost.GetSiteName()].Applications) - { - if (app.Path == HttpRuntime.AppDomainAppVirtualPath) { appPoolName = app.ApplicationPoolName; } - } - return appPoolName; - } - } - public class HangfireBootstrapper : IRegisteredObject - { - public static readonly HangfireBootstrapper Instance = new HangfireBootstrapper(); - public BackgroundJobServer _backgroundJobServer { get; set; } - public string SqlDBconnectionstring { get; set; } = null; - private readonly object _lockObject = new object(); - private bool _started; - - - private HangfireBootstrapper() - { - } - - public void Start() - { - lock (_lockObject) - { - if (_started) return; - _started = true; - - HostingEnvironment.RegisterObject(this); - - GlobalConfiguration.Configuration - .UseSqlServerStorage(SqlDBconnectionstring) - // Specify other options here - ; - - _backgroundJobServer = new BackgroundJobServer(); - } - } - - public void Stop() - { - lock (_lockObject) - { - if (_backgroundJobServer != null) { _backgroundJobServer.Dispose(); } - HostingEnvironment.UnregisterObject(this); - } - } - - void IRegisteredObject.Stop(bool immediate) { Stop(); } - } } diff --git a/Vrh.Web.Reporting/HangfireBootstrapper.cs b/Vrh.Web.Reporting/HangfireBootstrapper.cs new file mode 100644 index 0000000..e0585cd --- /dev/null +++ b/Vrh.Web.Reporting/HangfireBootstrapper.cs @@ -0,0 +1,217 @@ +using System.Text; +using System.Threading.Tasks; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net; +using System.Threading; +using System.Web; +using System.Web.Hosting; +using System.Web.Mvc; +using System.Web.Optimization; +using System.Web.Routing; +using System.Xml.Linq; +using Hangfire; +using Microsoft.Web.Administration; +using Vrh.Logger; + +namespace Vrh.Web.HangfireBootstrapperNS +{ + public class HangfireBootstrapper : IRegisteredObject, IProcessHostPreloadClient + { + public void Preload(string[] parameters) + { + var methodfullname = $"{typeof(HangfireBootstrapper).FullName}.{System.Reflection.MethodBase.GetCurrentMethod().Name}"; + (new DCLogEntry(LogLevel.Information, methodfullname)).Write(); + Initialize(); + } + public void Initialize() + { + SetupAutoStart(typeof(HangfireBootstrapper)); + HangfireBootstrapper.Instance.SqlDBconnectionstring = Vrh.XmlProcessing.ConnectionStringStore.GetSQL(HANGFIRESQLDBCONNECTIONSTRINGNAME); + HangfireBootstrapper.Instance.Start(); + Vrh.iScheduler.Monitor.InitHangfire(HangfireBootstrapper.Instance._backgroundJobServer); + } + + private const string HANGFIRESQLDBCONNECTIONSTRINGNAME = "MAINDBLOG4PRO"; + private const string CONFIGFILEDIRECTORY = @"inetsrv\config"; + private const string CONFIGFILENAME = @"applicationHost.config"; + //public const string FILEPATH = @"C:\temp\applicationHost.config"; + private const string POOLNAME = "Log4ProIS_REPORTING"; + private const string WEBAPPNAME = "/Log4ProIS-REPORTING"; + private const string WEBSITENAME = "Default Web Site"; + private const string AUTOSTARTPROVIDERNAME = "ApplicationPreload"; + private const string AUTOSTARTPROVIDERTYPENAME = "Vrh.Web.Reporting.ApplicationPreload"; + private const string AUTOSTARTPROVIDERASSEMBLYNAME = "Vrh.Web.Reporting"; + + private static bool SetupAutoStart(Type serviceAutoStartProviderType) + { + const string SYSTEMAPPLICATIONHOST_ELEMENT = "system.applicationHost"; + const string APPLICATIONPOOLS_ELEMENT = "applicationPools"; + const string SITES_ELEMENT = "sites"; + const string SERVICEAUTOSTARTPROVIDERS_ELEMENT = "serviceAutoStartProviders"; + const string SITE_ELEMENT = "site"; + const string APPLICATION_ELEMENT = "application"; + const string ADD_ELEMENT = "add"; + const string NAME_ATTRIBUTE = "name"; + const string TYPE_ATTRIBUTE = "type"; + const string SERVICEAUTOSTARTENABLED_ATTRIBUTE = "serviceAutoStartEnabled"; + const string SERVICEAUTOSTARTPROVIDER_ATTRIBUTE = "serviceAutoStartProvider"; + const string APPLICATIONPOOL_ATTRIBUTE = "applicationPool"; + const string PATH_ATTRIBUTE = "path"; + const string AUTOSTART_ATTRIBUTE = "autoStart"; + const string STARTMODE_ATTRIBUTE = "startMode"; + + string applicationpoolname = GetCurrentApplicationPoolName(); + string websitename = System.Web.Hosting.HostingEnvironment.SiteName; + string webapplicationname = System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath; + string autostartprovidername = (websitename + "____" + applicationpoolname + "____" + webapplicationname).Replace(" ", "_").Replace("-", "_").Replace("/", "_"); + string serviceAutoStartProviderTypeFullName = serviceAutoStartProviderType.FullName; + string serviceAutoStartProviderAssassemblyName = serviceAutoStartProviderType.Assembly.GetName().Name; + var methodfullname = $"{typeof(HangfireBootstrapper).FullName}.{System.Reflection.MethodBase.GetCurrentMethod().Name}"; + var le = new DCLogEntry(LogLevel.Information, methodfullname); + try + { + string configfilepath = Path.Combine(NativeSystemPath, CONFIGFILEDIRECTORY, CONFIGFILENAME); + le.AddDataField("configfilepath", configfilepath); + le.AddDataField("applicationpoolname", applicationpoolname); + le.AddDataField("websitename", websitename); + le.AddDataField("webapplicationname", webapplicationname); + le.AddDataField("serviceAutoStartProviderTypeFullName", serviceAutoStartProviderTypeFullName); + le.AddDataField("serviceAutoStartProviderAssassemblyName", serviceAutoStartProviderAssassemblyName); + + + var filecontent = System.IO.File.ReadAllText(configfilepath); + XElement configxml = XElement.Parse(filecontent, LoadOptions.PreserveWhitespace); //XElement.Load(configfilepath); + + XElement myconfigrootxml = configxml.Element(XName.Get(SYSTEMAPPLICATIONHOST_ELEMENT)); + XElement myapplicationpooladdelement = myconfigrootxml?.Element(XName.Get(APPLICATIONPOOLS_ELEMENT))? + .Elements(XName.Get(ADD_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(NAME_ATTRIBUTE)).Value == applicationpoolname); + XElement mysiteapplicationelement = myconfigrootxml?.Element(XName.Get(SITES_ELEMENT))? + .Elements(XName.Get(SITE_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(NAME_ATTRIBUTE)).Value == websitename) + .Elements(XName.Get(APPLICATION_ELEMENT))?.FirstOrDefault(e => e.Attribute(XName.Get(PATH_ATTRIBUTE)).Value == webapplicationname && e.Attribute(XName.Get(APPLICATIONPOOL_ATTRIBUTE)).Value == applicationpoolname); + if (myapplicationpooladdelement == null) return false; + if (mysiteapplicationelement == null) return false; + + bool configchanged = false; + configchanged = SetOrAddAttribute(AUTOSTART_ATTRIBUTE, myapplicationpooladdelement, "true") || configchanged; + configchanged = SetOrAddAttribute(STARTMODE_ATTRIBUTE, myapplicationpooladdelement, "AlwaysRunning") || configchanged; + configchanged = SetOrAddAttribute(SERVICEAUTOSTARTENABLED_ATTRIBUTE, mysiteapplicationelement, "true") || configchanged; + configchanged = SetOrAddAttribute(SERVICEAUTOSTARTPROVIDER_ATTRIBUTE, mysiteapplicationelement, autostartprovidername) || configchanged; + + XElement myautostartproviderselement = null; + XElement myautostartprovideraddelement = null; + configchanged = SetOrAddElement(SERVICEAUTOSTARTPROVIDERS_ELEMENT, myconfigrootxml, "", out myautostartproviderselement) || configchanged; + configchanged = SetOrAddElementWithSelectorAttribute(ADD_ELEMENT, myautostartproviderselement, NAME_ATTRIBUTE, autostartprovidername, "", out myautostartprovideraddelement) || configchanged; + configchanged = SetOrAddAttribute(TYPE_ATTRIBUTE, myautostartprovideraddelement, $"{serviceAutoStartProviderTypeFullName},{serviceAutoStartProviderAssassemblyName }") || configchanged; + + if (configchanged) + { + //configxml.Save(configfilepath); + System.IO.File.WriteAllText(configfilepath, configxml.ToString()); + } + le.AddDataField("configchanged", configchanged); + //le.AddDataField("myconfigrootxml", myconfigrootxml); + le.AddSuccessResult("SUCCESS"); + return true; + } + catch (Exception ex) { le.AddExceptionResult(ex); le.SetLogLevel(LogLevel.Error); return false; } + finally { le.Write(); } + } + private static bool SetOrAddElement(string elementname, XElement elementcontainer, string elementvalue, out XElement myelement) + { + bool configchanged = false; + myelement = elementcontainer?.Element(XName.Get(elementname)); + if (myelement == null) { myelement = new XElement(XName.Get(elementname), ""); elementcontainer.Add(myelement); configchanged = true; } + if (myelement.Value != elementvalue) { myelement.Value = elementvalue; configchanged = true; } + return configchanged; + } + private static bool SetOrAddElementWithSelectorAttribute(string elementname, XElement elementcontainer, string selectorattributename, string selectorattributevalue, string elementvalue, out XElement myelement) + { + bool configchanged = false; + myelement = elementcontainer?.Elements(XName.Get(elementname))?.FirstOrDefault(e => e.Attribute(XName.Get(selectorattributename)).Value == selectorattributevalue); + if (myelement == null) + { + myelement = new XElement(XName.Get(elementname), ""); + elementcontainer.Add(myelement); + SetOrAddAttribute(selectorattributename, myelement, selectorattributevalue); + configchanged = true; + } + if (myelement.Value != elementvalue) { myelement.Value = elementvalue; configchanged = true; } + return configchanged; + } + private static bool SetOrAddAttribute(string attrname, XElement attrcontainer, string attrvalue) + { + bool configchanged = false; + XAttribute attr = attrcontainer.Attribute(XName.Get(attrname)); + if (attr == null) { attr = new XAttribute(XName.Get(attrname), ""); attrcontainer.Add(attr); configchanged = true; } + if (attr.Value != attrvalue) { attr.Value = attrvalue; configchanged = true; } + return configchanged; + } + private static string NativeSystemPath + { + get + { + if (Environment.Is64BitOperatingSystem) + { + return System.IO.Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.Windows), + "Sysnative"); + } + return Environment.GetFolderPath(Environment.SpecialFolder.System); + } + } + + private static string GetCurrentApplicationPoolName() + { + string appPoolName = string.Empty; + foreach (Application app in (new ServerManager()).Sites[System.Web.Hosting.HostingEnvironment.ApplicationHost.GetSiteName()].Applications) + { + if (app.Path == HttpRuntime.AppDomainAppVirtualPath) { appPoolName = app.ApplicationPoolName; } + } + return appPoolName; + } + + public static readonly HangfireBootstrapper Instance = new HangfireBootstrapper(); + private BackgroundJobServer _backgroundJobServer { get; set; } + private string SqlDBconnectionstring { get; set; } = null; + private readonly object _lockObject = new object(); + private bool _started; + + + public HangfireBootstrapper() + { + } + + public void Start() + { + lock (_lockObject) + { + if (_started) return; + _started = true; + + HostingEnvironment.RegisterObject(this); + + GlobalConfiguration.Configuration + .UseSqlServerStorage(SqlDBconnectionstring) + // Specify other options here + ; + + _backgroundJobServer = new BackgroundJobServer(); + } + } + + public void Stop() + { + lock (_lockObject) + { + if (_backgroundJobServer != null) { _backgroundJobServer.Dispose(); } + HostingEnvironment.UnregisterObject(this); + } + } + + void IRegisteredObject.Stop(bool immediate) { Stop(); } + } +} diff --git a/Vrh.Web.Reporting/Vrh.Web.Reporting.csproj b/Vrh.Web.Reporting/Vrh.Web.Reporting.csproj index 73ce1b4..6a97465 100644 --- a/Vrh.Web.Reporting/Vrh.Web.Reporting.csproj +++ b/Vrh.Web.Reporting/Vrh.Web.Reporting.csproj @@ -329,6 +329,7 @@ Global.asax + -- libgit2 0.21.2