Description
Description
I have not changed any code. I made a minor change recently to my UWP application. I noticed that some of the packages were out of rev, so I pulled them down and started getting strange "Missing Metadata" exceptions when trying to instantiate my views (again, working great prior to this). The exception happened in this statement:
BlotterView blotterView = this.serviceProvider.GetRequiredService<BlotterView>();
Exception thrown: 'System.IO.FileNotFoundException' in System.Private.Reflection.Core.dll
Exception thrown: 'System.Reflection.MissingMetadataException' in System.Private.Reflection.Core.dll
'Microsoft.Extensions.Options.IPostConfigureOptions<>' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859
So I rolled back all the package updates I made until these three packages appear to be the cause of the problem:
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.9" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.15.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.9" />
I don't know which one, exactly, is causing the problem, but with the 5.0.0 version, I get this crash.
EDIT: As nearly as I can diagnose, the issue is with the upgrade of the Microsoft.Extensions.Options 5.0 package
Configuration
This error only occurs when compiling with the .NET Native toolchain
.NET: .NET Standard 2.0
Windows: Windows 10 10.0.19042
Architecture: 64
Regression?
Fall back from:
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.16.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="5.0.0" />
to
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.9" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.15.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.9" />
makes it work again. Also, turning off the "Compile with Native toolset* option will make it work again.