/// <summary>
 /// Gets the instance of the standalone Umbraco application.
 /// </summary>
 public static StandaloneCoreApplication GetApplication(string baseDirectory)
 {
     lock (AppLock)
     {
         return(_application ?? (_application = new StandaloneCoreApplication(baseDirectory)));
     }
 }
Esempio n. 2
0
        public ServiceContextManager(string connectionString, string providerName, string baseDirectory)
        {
            _connectionString = connectionString;
            _providerName     = providerName;

            Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.FriendlyName);
            Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.BaseDirectory);

            //var webAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.FullName.StartsWith("umbraco"));
            //if (webAssembly != null && examineEventHandlerToRemove == null)
            //{
            //    var examineEventType = webAssembly.GetType("Umbraco.Web.Search.ExamineEvents");
            //    examineEventHandlerToRemove = examineEventType;
            //}

            _application = StandaloneCoreApplication.GetApplication(baseDirectory);

            var examineEventHandlerToRemove = Type.GetType("Umbraco.Web.Search.ExamineEvents, umbraco");

            if (examineEventHandlerToRemove != null)
            {
                _application.WithoutApplicationEventHandler(examineEventHandlerToRemove);
            }

            _application.Start();
        }