-
-
Notifications
You must be signed in to change notification settings - Fork 696
Open
Description
We have a common method to scan types for automatic DI, but when scanning ZXing.Windows.Compatibility
, it causes an Exception
Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
File name: 'PresentationCore, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at System.Reflection.RuntimeAssembly.GetExportedTypes()
To reproduce:
csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ZXing.Net" Version="0.16.10" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.13" />
</ItemGroup>
</Project>
code
public class Program
{
public static void Main(string[] args)
{
var assemblyExportedTypes1 = typeof(ZXing.Windows.Compatibility.BarcodeReader).Assembly.ExportedTypes;
Console.WriteLine(assemblyExportedTypes1);
}
}
Metadata
Metadata
Assignees
Labels
No labels