1

In my current project I need to use the Windows Media Transcoding API. However, I can't manage to install it.

Here you can see I'm using the correct namespace.

using System.Windows.Media.Transcoding;

I looked around on NuGet, but couldn't find it there. I read the Microsoft page about it, but that only told me the namespace. I also couldn't find it's Assembly. Could someone please help me install it.

Drake
  • 8,225
  • 15
  • 71
  • 104
Jonty Morris
  • 797
  • 1
  • 10
  • 25

1 Answers1

3

You can follow these instructions:

Modify the target platform by opening your .csproj file with an external editor and add the line

<TargetPlatformVersion>8.0</TargetPlatformVersion>

as for this example

<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{6D41F51D-5A85-4826-9868-14FB3591F280}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>WindowsFormsApplication1</RootNamespace>
    <AssemblyName>UseWindowsMediaTranscodingAPI</AssemblyName>
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>

Reload the solution and add a reference to Windows Core Media DLL

add reference to Windows Core Media

This should already compile.

Additionally to be able handle events and async methods mapping you should add the reference to the system dll:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.InteropServices.WindowsRuntime

Remember that the application will work only on Windows 10.

Source: https://blogs.msdn.microsoft.com/cdndevs/2013/10/02/using-windows-8-winrt-apis-in-net-desktop-applications/

Drake
  • 8,225
  • 15
  • 71
  • 104