1
votes

I am trying to use SourceAFIS 1.7.0 on Ubuntu with mono and get a few error.

1.

$ mono DatabaseAnalyzer.exe

Scanning folder TestDatabase

Running extractor benchmark

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

File name: 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

at DatabaseAnalyzer.DatabaseAnalyzer.RunExtractorBenchmark () <0x40674790 + 0x00033> in :0 at DatabaseAnalyzer.DatabaseAnalyzer.RunMatcherBenchmark () <0x40674600 + 0x000eb> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Run () <0x40642a40 + 0x000bf> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Main (System.String[] args) <0x4063bd50 + 0x00037> in :0

[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

File name: 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at DatabaseAnalyzer.DatabaseAnalyzer.RunExtractorBenchmark () <0x40674790 + 0x00033> in :0 at DatabaseAnalyzer.DatabaseAnalyzer.RunMatcherBenchmark () <0x40674600 + 0x000eb> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Run () <0x40642a40 + 0x000bf> in :0

at DatabaseAnalyzer.DatabaseAnalyzer.Main (System.String[] args) <0x4063bd50 + 0x00037> in :0

According to https://sourceforge.net/p/sourceafis/discussion/1051112/thread/dd8df289/#a006, WinForms should be applied here instead of WPF and use bitmap class to replace the bitmapimage class of WPF, but I don't know how to do it exactly. Does anybody have such experience?

This is the original function used WPF bitmap class

  static MyPerson Enroll(string filename, string name)
        {
            Console.WriteLine("Enrolling {0}...", name);

            // Initialize empty fingerprint object and set properties
            MyFingerprint fp = new MyFingerprint();
            fp.Filename = filename;
            // Load image from the file
            Console.WriteLine(" Loading image from {0}...", filename);
            BitmapImage image = new BitmapImage(new Uri(filename, UriKind.RelativeOrAbsolute));
            fp.AsBitmapSource = image;
            // Above update of fp.AsBitmapSource initialized also raw image in fp.Image
            // Check raw image dimensions, Y axis is first, X axis is second
            Console.WriteLine(" Image size = {0} x {1} (width x height)", fp.Image.GetLength(1), fp.Image.GetLength(0));

            // Initialize empty person object and set its properties
            MyPerson person = new MyPerson();
            person.Name = name;
            // Add fingerprint to the person
            person.Fingerprints.Add(fp);

            // Execute extraction in order to initialize fp.Template
            Console.WriteLine(" Extracting template...");
            Afis.Extract(person);
            // Check template size
            Console.WriteLine(" Template size = {0} bytes", fp.Template.Length);

            return person;
        }
  1. $ mono SourceAFIS.FingerprintAnalysis.exe
    The entry point method could not be loaded

How can I fix this with a more meaningful exception?

2
what version of mono and what distro and version is this?user1623521
I am using Ubuntu15.10 64bit and mono 4.4.0Chalene Yuan
how did you install mono?user1623521
With the instruction on Mono website hereChalene Yuan

2 Answers

1
votes

WinForms should be applied here instead of WPF and use bitmap class to replace the bitmapimage class of WPF, but I don't know how to do it exactly. Does anybody have such experience?

Do you know how to program in C# language? What they mean in that forum is that you need to change the code to not use the WPF library, but Windows Forms UI toolkit.

If you get exceptions trying to load "PresentationCore" at runtime, it means it's still trying to load WPF.

0
votes

Try installing mono-complete package, e.g.

apt-get install mono-complete

Related: Mono, failing to open executable.

Also make sure you've .NET Framework installed, e.g. by using winetricks:

apt-get install winetricks
winetricks dotnet46

See: Could not load file or assembly 'PresentationCore'.

PresentationCore is .NET 4


Further more, you can try the following suggestions:

  • In IIS try to Enable 32-Bit Applications in the Application Pools's Advanced Settings
  • Configure authentication as follow:

    • Disable Anonymous Authentication.
    • Enable ASP.NET Impersonation.
    • Enable Windows Authentication.