I am trying to use the Windows Media Import API in a WPF Application I have added a reference to the Windows Runtime but still failing to get it to run. Any ideas what the missing references may be?
CodePudding user response:
Your .csproj
is targeting an ancient and unsupported version of .NET Framework, specifically: .NET Framework 4.0 which dates back to 2010, which is before the IReadOnly...<T>
collection interface types were added to .NET in .NET Framework 4.5 in 2012.
As it's 2021, you should now be targeting either .NET Framework 4.8 - or .NET 5. As porting to .NET 5 is a large undertaking, just update to .NET 4.8:
So change this:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
to this:
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>