Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to AssemblyLoadContext for assembly retrival #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions src/HEAL.Attic.Benchmarks/HEAL.Attic.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Version>1.8.0</Version>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<NeutralLanguage></NeutralLanguage>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HEAL.Attic\HEAL.Attic.csproj" />
</ItemGroup>

</Project>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Version>1.8.0</Version>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<NeutralLanguage>
</NeutralLanguage>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HEAL.Attic\HEAL.Attic.csproj" />
</ItemGroup>
</Project>
10 changes: 3 additions & 7 deletions src/HEAL.Attic.Tests/HEAL.Attic.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<Version>1.8.0</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="MSTest.TestAdapter" Version="1.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="1.3.2" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HEAL.Attic\HEAL.Attic.csproj" />
</ItemGroup>

</Project>
</Project>
3 changes: 2 additions & 1 deletion src/HEAL.Attic/Core/StaticCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.Loader;

namespace HEAL.Attic {
public sealed class StaticCache {
Expand Down Expand Up @@ -137,7 +138,7 @@ internal StaticCache() {
}

public void UpdateRegisteredTypes() {
foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (var asm in AssemblyLoadContext.Default.Assemblies) {
if (asm.IsDynamic) continue;
if (cachedAssemblies.Contains(asm.FullName)) continue;
cachedAssemblies.Add(asm.FullName);
Expand Down
9 changes: 3 additions & 6 deletions src/HEAL.Attic/HEAL.Attic.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<Authors>Heuristic and Evolutionary Algorithms Laboratory (HEAL) and Contributors</Authors>
<Company>University of Applied Sciences Upper Austria</Company>
<Copyright>(c) Heuristic and Evolutionary Algorithms Laboratory (HEAL)</Copyright>
Expand All @@ -14,11 +13,9 @@
<RepositoryType>git</RepositoryType>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.15.0" />
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<None Include="../../LICENSE.txt" Pack="true" PackagePath="" />
<PackageReference Include="System.Drawing.Common" Version="8.0.7" />
</ItemGroup>

</Project>
</Project>
Loading