Skip to content

Commit f4800d5

Browse files
Change target framework and remove no longer required dependencies (#81)
2 parents 91ef878 + 8bc3635 commit f4800d5

File tree

6 files changed

+8
-122
lines changed

6 files changed

+8
-122
lines changed

Excel_Adapter/ExcelAdapter.cs

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
using BH.oM.Adapters.Excel;
2525
using BH.oM.Base.Attributes;
2626
using BH.oM.Data.Requests;
27+
using System;
2728
using System.ComponentModel;
2829
using System.IO;
30+
using System.Linq;
2931
using System.Reflection;
30-
using System.Security;
31-
using System.Security.Policy;
3232
using System.Threading;
3333

3434
namespace BH.Adapter.Excel
@@ -57,10 +57,6 @@ public ExcelAdapter(BH.oM.Adapter.FileSettings fileSettings = null)
5757
}
5858

5959
m_FileSettings = fileSettings;
60-
61-
// This is needed because of save action of large files being made with an isolated storage
62-
// Fox taken from http://rekiwi.blogspot.com/2008/12/unable-to-determine-identity-of-domain.html
63-
VerifySecurityEvidenceForIsolatedStorage(this.GetType().Assembly);
6460
}
6561

6662
/***************************************************/
@@ -80,6 +76,7 @@ public ExcelAdapter(Stream inputStream, Stream outputStream = null)
8076
m_OutputStream = outputStream;
8177
}
8278

79+
8380
/***************************************************/
8481
/**** Override Methods ****/
8582
/***************************************************/
@@ -96,45 +93,6 @@ public override bool SetupPullRequest(object request, out IRequest actualRequest
9693
}
9794

9895

99-
/***************************************************/
100-
/**** Private Methods ****/
101-
/***************************************************/
102-
103-
private void VerifySecurityEvidenceForIsolatedStorage(Assembly assembly)
104-
{
105-
var isEvidenceFound = true;
106-
#if ZCTDEPLOY
107-
var initialAppDomainEvidence = new Evidence();
108-
#else
109-
var initialAppDomainEvidence = System.Threading.Thread.GetDomain().Evidence;
110-
#endif
111-
112-
try
113-
{
114-
// this will fail when the current AppDomain Evidence is instantiated via COM or in PowerShell
115-
using (var usfdAttempt1 = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForDomain())
116-
{
117-
}
118-
}
119-
catch (System.IO.IsolatedStorage.IsolatedStorageException e)
120-
{
121-
isEvidenceFound = false;
122-
}
123-
124-
if (!isEvidenceFound)
125-
{
126-
initialAppDomainEvidence.AddHostEvidence(new Url(assembly.Location));
127-
initialAppDomainEvidence.AddHostEvidence(new Zone(SecurityZone.MyComputer));
128-
129-
var currentAppDomain = Thread.GetDomain();
130-
var securityIdentityField = currentAppDomain.GetType().GetField("_SecurityIdentity", BindingFlags.Instance | BindingFlags.NonPublic);
131-
securityIdentityField.SetValue(currentAppDomain, initialAppDomainEvidence);
132-
133-
//var latestAppDomainEvidence = System.Threading.Thread.GetDomain().Evidence; // setting a breakpoint here will let you inspect the current app domain evidence
134-
}
135-
}
136-
137-
13896
/***************************************************/
13997
/**** Private Fields ****/
14098
/***************************************************/

Excel_Adapter/Excel_Adapter.csproj

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
45
<AssemblyVersion>8.0.0.0</AssemblyVersion>
56
<Description>https://github.com/BHoM/Excel_Toolkit</Description>
67
<Version>5.0.0</Version>
@@ -13,14 +14,7 @@
1314
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1415
</PropertyGroup>
1516

16-
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
17-
<TargetFramework>net472</TargetFramework>
18-
<DefineConstants>INSTALLERDEPLOY</DefineConstants>
19-
</PropertyGroup>
20-
<PropertyGroup Condition="'$(Configuration)'=='ZeroCodeTool'">
21-
<TargetFramework>netstandard2.0</TargetFramework>
22-
<DefineConstants>ZCTDEPLOY</DefineConstants>
23-
</PropertyGroup>
17+
2418

2519
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
2620
<Exec Command="xcopy &quot;$(TargetPath)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /C /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ClosedXML.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)ExcelNumberFormat.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)DocumentFormat.OpenXml.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)SixLabors.Fonts.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)System.IO.Packaging.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)Irony.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y&#xD;&#xA;xcopy &quot;$(TargetDir)XLParser.dll&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
@@ -68,35 +62,15 @@
6862
<HintPath>$(ProgramData)\BHoM\Assemblies\Reflection_Engine.dll</HintPath>
6963
</Reference>
7064
</ItemGroup>
71-
72-
<ItemGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
73-
<Reference Include="System" />
74-
<Reference Include="System.Core" />
75-
<Reference Include="System.Xml.Linq" />
76-
<Reference Include="System.Data.DataSetExtensions" />
77-
<Reference Include="Microsoft.CSharp" />
78-
<Reference Include="System.Data" />
79-
<Reference Include="System.Net.Http" />
80-
<Reference Include="System.Xml" />
81-
<Reference Include="WindowsBase" />
82-
</ItemGroup>
8365

8466
<ItemGroup>
67+
<Reference Include="Microsoft.CSharp" />
8568
<PackageReference Include="ClosedXML" Version="0.102.2" />
8669
<PackageReference Include="DocumentFormat.OpenXml" Version="2.16.0" />
8770
<PackageReference Include="ExcelNumberFormat" Version="1.1.0" />
8871
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
8972
<PackageReference Include="SixLabors.Fonts" Version="1.0.0" />
9073
<PackageReference Include="System.IO.Packaging" Version="6.0.0" />
91-
<PackageReference Include="System.Security.AccessControl" Version="6.0.2-mauipre.1.22102.15" />
92-
<PackageReference Include="System.Security.Permissions" Version="8.0.0" />
93-
</ItemGroup>
94-
95-
<ItemGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
96-
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
97-
</ItemGroup>
98-
99-
<ItemGroup Condition="'$(Configuration)'=='ZeroCodeTool'">
10074
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
10175
</ItemGroup>
10276

Excel_Engine/Excel_Engine.csproj

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
45
<AssemblyVersion>8.0.0.0</AssemblyVersion>
56
<Description>https://github.com/BHoM/Excel_Toolkit</Description>
67
<Version>5.0.0</Version>
@@ -13,15 +14,6 @@
1314
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1415
</PropertyGroup>
1516

16-
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
17-
<TargetFramework>net472</TargetFramework>
18-
<DefineConstants>INSTALLERDEPLOY</DefineConstants>
19-
</PropertyGroup>
20-
<PropertyGroup Condition="'$(Configuration)'=='ZeroCodeTool'">
21-
<TargetFramework>netstandard2.0</TargetFramework>
22-
<DefineConstants>ZCTDEPLOY</DefineConstants>
23-
</PropertyGroup>
24-
2517
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
2618
<Exec Command="xcopy &quot;$(TargetDir)$(TargetFileName)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
2719
</Target>
@@ -47,16 +39,5 @@
4739
<Private>False</Private>
4840
</Reference>
4941
</ItemGroup>
50-
51-
<ItemGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
52-
<Reference Include="System" />
53-
<Reference Include="System.Core" />
54-
<Reference Include="System.Xml.Linq" />
55-
<Reference Include="System.Data.DataSetExtensions" />
56-
<Reference Include="Microsoft.CSharp" />
57-
<Reference Include="System.Data" />
58-
<Reference Include="System.Net.Http" />
59-
<Reference Include="System.Xml" />
60-
</ItemGroup>
6142

6243
</Project>

Excel_Toolkit.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,20 @@ Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1414
Debug|Any CPU = Debug|Any CPU
1515
Release|Any CPU = Release|Any CPU
16-
ZeroCodeTool|Any CPU = ZeroCodeTool|Any CPU
1716
EndGlobalSection
1817
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1918
{79D1BABE-DF98-4635-A605-AA396FF58915}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2019
{79D1BABE-DF98-4635-A605-AA396FF58915}.Debug|Any CPU.Build.0 = Debug|Any CPU
2120
{79D1BABE-DF98-4635-A605-AA396FF58915}.Release|Any CPU.ActiveCfg = Release|Any CPU
2221
{79D1BABE-DF98-4635-A605-AA396FF58915}.Release|Any CPU.Build.0 = Release|Any CPU
23-
{79D1BABE-DF98-4635-A605-AA396FF58915}.ZeroCodeTool|Any CPU.ActiveCfg = ZeroCodeTool|Any CPU
24-
{79D1BABE-DF98-4635-A605-AA396FF58915}.ZeroCodeTool|Any CPU.Build.0 = ZeroCodeTool|Any CPU
2522
{A6884466-297E-4AAA-A232-ABBEC42168D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2623
{A6884466-297E-4AAA-A232-ABBEC42168D3}.Debug|Any CPU.Build.0 = Debug|Any CPU
2724
{A6884466-297E-4AAA-A232-ABBEC42168D3}.Release|Any CPU.ActiveCfg = Release|Any CPU
2825
{A6884466-297E-4AAA-A232-ABBEC42168D3}.Release|Any CPU.Build.0 = Release|Any CPU
29-
{A6884466-297E-4AAA-A232-ABBEC42168D3}.ZeroCodeTool|Any CPU.ActiveCfg = ZeroCodeTool|Any CPU
30-
{A6884466-297E-4AAA-A232-ABBEC42168D3}.ZeroCodeTool|Any CPU.Build.0 = ZeroCodeTool|Any CPU
3126
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3227
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.Debug|Any CPU.Build.0 = Debug|Any CPU
3328
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3429
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.Release|Any CPU.Build.0 = Release|Any CPU
35-
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.ZeroCodeTool|Any CPU.ActiveCfg = ZeroCodeTool|Any CPU
36-
{79FAC4B0-77EC-4257-BCBE-CFF37FFF537C}.ZeroCodeTool|Any CPU.Build.0 = ZeroCodeTool|Any CPU
3730
EndGlobalSection
3831
GlobalSection(SolutionProperties) = preSolution
3932
HideSolutionNode = FALSE

Excel_oM/Excel_oM.csproj

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
45
<AssemblyVersion>8.0.0.0</AssemblyVersion>
56
<Description>https://github.com/BHoM/Excel_Toolkit</Description>
67
<Version>5.0.0</Version>
@@ -13,15 +14,6 @@
1314
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
1415
</PropertyGroup>
1516

16-
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
17-
<TargetFramework>net472</TargetFramework>
18-
<DefineConstants>INSTALLERDEPLOY</DefineConstants>
19-
</PropertyGroup>
20-
<PropertyGroup Condition="'$(Configuration)'=='ZeroCodeTool'">
21-
<TargetFramework>netstandard2.0</TargetFramework>
22-
<DefineConstants>ZCTDEPLOY</DefineConstants>
23-
</PropertyGroup>
24-
2517
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
2618
<Exec Command="xcopy &quot;$(TargetDir)$(TargetFileName)&quot; &quot;$(ProgramData)\BHoM\Assemblies&quot; /Y" />
2719
</Target>
@@ -43,16 +35,5 @@
4335
<SpecificVersion>False</SpecificVersion>
4436
</Reference>
4537
</ItemGroup>
46-
<ItemGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'">
47-
<Reference Include="System" />
48-
<Reference Include="System.Core" />
49-
<Reference Include="System.Xml.Linq" />
50-
<Reference Include="System.Data.DataSetExtensions" />
51-
<Reference Include="Microsoft.CSharp" />
52-
<Reference Include="System.Data" />
53-
<Reference Include="System.Net.Http" />
54-
<Reference Include="System.Xml" />
55-
<Reference Include="WindowsBase" />
56-
</ItemGroup>
5738

5839
</Project>

altConfigs.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)