diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs index 19ae437..58002ee 100644 --- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs +++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs @@ -8,7 +8,7 @@ using System.Net; namespace RhSolutions.AddIn { - public class RhSolutionsAddIn : IExcelAddIn + public sealed class RhSolutionsAddIn : IExcelAddIn { public static Application Excel { get; private set; } public static ServiceProvider ServiceProvider { get; set; } @@ -17,15 +17,16 @@ namespace RhSolutions.AddIn public void AutoOpen() { IServiceCollection Services = new ServiceCollection(); - Excel = (Application)ExcelDnaUtil.Application; Services.AddHttpClient() .AddSingleton() - .AddSingleton(); + .AddSingleton() + .AddSingleton(ExcelDnaUtil.Application); ServiceProvider = Services.BuildServiceProvider(); Configuration = ServiceProvider.GetService(); - + Excel = ServiceProvider.GetService(); + IntelliSenseServer.Install(); EventsUtil.Initialize();