diff options
-rw-r--r-- | RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs | 24 | ||||
-rw-r--r-- | RhSolutions.AddIn/RhSolutions-AddIn.dna | 1 | ||||
-rw-r--r-- | RhSolutions.AddIn/RhSolutions.AddIn.csproj | 1 | ||||
-rw-r--r-- | RhSolutions.Tests/.runsettings | 8 |
4 files changed, 33 insertions, 1 deletions
diff --git a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs index 2ddff1a..7d70ef0 100644 --- a/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs +++ b/RhSolutions.AddIn/AddIn/RhSolutionsAddIn.cs @@ -1,4 +1,5 @@ using System.Net; +using ExcelDna.IntelliSense; #if !NET472 using System.Runtime.Versioning; #endif @@ -40,12 +41,33 @@ public sealed class RhSolutionsAddIn : IExcelAddIn Excel = ServiceProvider.GetService<Application>(); EventsUtil.Initialize(); + string variable = Environment.GetEnvironmentVariable("ISTESTING"); + bool isTesting = variable switch + { + "true" => true, + "false" => false, + _ => false + }; + if (!isTesting) + { + IntelliSenseServer.Install(); + } + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; } public void AutoClose() { - EventsUtil.Uninitialize(); + EventsUtil.Uninitialize(); bool isTesting = Environment.GetEnvironmentVariable("ISTESTING") switch + { + "true" => true, + "false" => false, + _ => false + }; + if (!isTesting) + { + IntelliSenseServer.Uninstall(); + } } } diff --git a/RhSolutions.AddIn/RhSolutions-AddIn.dna b/RhSolutions.AddIn/RhSolutions-AddIn.dna index 32a6910..1ece3ec 100644 --- a/RhSolutions.AddIn/RhSolutions-AddIn.dna +++ b/RhSolutions.AddIn/RhSolutions-AddIn.dna @@ -12,6 +12,7 @@ <Reference Path="Microsoft.Extensions.Logging.dll" Pack="true" /> <Reference Path="Microsoft.Extensions.Options.dll" Pack="true" /> <Reference Path="Microsoft.Extensions.Primitives.dll" Pack="true" /> + <Reference Path="ExcelDna.IntelliSense.dll" Pack="true" /> <Reference Path="Newtonsoft.Json.dll" Pack="true" /> <Reference Path="netDxf.dll" Pack="true" /> <Reference Path="RhSolutions.ProductSku.dll" Pack="true" /> diff --git a/RhSolutions.AddIn/RhSolutions.AddIn.csproj b/RhSolutions.AddIn/RhSolutions.AddIn.csproj index 3bf1071..63071ec 100644 --- a/RhSolutions.AddIn/RhSolutions.AddIn.csproj +++ b/RhSolutions.AddIn/RhSolutions.AddIn.csproj @@ -29,6 +29,7 @@ <TreatAsUsed>true</TreatAsUsed> </PackageReference> <PackageReference Include="ExcelDna.Integration" Version="1.6.0" /> + <PackageReference Include="ExcelDna.IntelliSense" Version="1.6.0" /> <PackageReference Include="ExcelDna.Interop" Version="15.0.1" /> <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" /> <PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" /> diff --git a/RhSolutions.Tests/.runsettings b/RhSolutions.Tests/.runsettings new file mode 100644 index 0000000..5f93304 --- /dev/null +++ b/RhSolutions.Tests/.runsettings @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8" ?> +<RunSettings> + <RunConfiguration> + <EnvironmentVariables> + <ISTESTING>true</ISTESTING> + </EnvironmentVariables> + </RunConfiguration> +</RunSettings>
\ No newline at end of file |