1

I am following this article: https://www.codeproject.com/Articles/285964/WPF-Webcam-Control?fid=1666019&df=90&mpp=25&sort=Position&spc=Relaxed&prof=True&view=Normal&fr=1#xx0xx When I run the program I always get the same error. Error: System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Expression.Encoder.Utilities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.'

I tried to find that Utilities file but I couldn't find it. I checked the comments on the article and there were a couple of people with the same problem. I did change the Active solution platform to x86 as well but that did nothing.

using System.Windows;
using Microsoft.Expression.Encoder.Devices;
using System.Collections.ObjectModel;


namespace Webcam
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public Collection<EncoderDevice> VideoDevices { get; set; }
        public Collection<EncoderDevice> AudioDevices { get; set; }

        public MainWindow()
        {
            InitializeComponent();

            this.DataContext = this;

            VideoDevices = 
EncoderDevices.FindDevices(EncoderDeviceType.Video);
            AudioDevices = 
EncoderDevices.FindDevices(EncoderDeviceType.Audio);
        }
 }

The error always occurs on the line VideoDevices = EncoderDevices.FindDevices(EncoderDeviceType.Video);

E.Leyva
  • 53
  • 5
  • Duplicate of https://stackoverflow.com/questions/29283833/where-to-get-dll-for-microsoft-expression-encoder-devices. The link to the DLL can be found in the requirements section of your Codeproject link. – ckuri Feb 12 '19 at 20:17
  • @ckuri I think that is a seperate issue because I have the Microsoft.Expression.Encoder.Devices dll – E.Leyva Feb 12 '19 at 20:24
  • 1
    Sorry, I didn’t see the different DLL names. I looked into the setup file with 7-zip and it contains an EnComn.cab file which contains an 8 MB large Microsoft.Expression.Encoder.Utilities file which is missing the DLL extension but is clearly a .NET DLL. So I assume the DLL is somewhere on your hard drive although it may be missing the DLL extension. – ckuri Feb 12 '19 at 20:38
  • Where is this setup file you mentioned? – E.Leyva Feb 12 '19 at 21:06
  • 1
    The linked setup in the requirements section of your Codeproject link: http://www.microsoft.com/en-us/download/details.aspx?id=27870 – ckuri Feb 12 '19 at 21:08
  • @ckuri Thank you so much it is finally working now. What I didn't realize was that installing the package for the webcam controls was not enough, even though it did contain the Microsoft.Expression.Encoder.dll I needed, I just installed the sdk and the project runs smoothly. Thanks for your patience. – E.Leyva Feb 12 '19 at 21:47
  • The link appears to be broken... – Prince Owen Aug 20 '20 at 11:10

1 Answers1

0

Download Microsoft Expression Encoder 4 : https://www.microsoft.com/en-in/download/details.aspx?id=18974

Install it on your system, so required dll will be install on your machine. Now build your application and run. it will work.