Laden...

mscorlib.dll Error bei Aufruf einer Matlab Funktion im c#

Erstellt von philllllllllllll vor 6 Jahren Letzter Beitrag vor 6 Jahren 1.418 Views
P
philllllllllllll Themenstarter:in
1 Beiträge seit 2017
vor 6 Jahren
mscorlib.dll Error bei Aufruf einer Matlab Funktion im c#

Hallo,

Ich habe eine Matlab Funktion. Diese rufe ich meinem C# Projekt mittels Add.dll usw. auf. Leider bekomme ich immer eine Fehlermeldung. Ich weiß leider nicht warum? Die Fehlermeldung erscheint zur gleichen Zeit wie der fertige (richtige) Output meiner Funktion. Liegt es an einer fehlerhaften c#-Matlab Daten Kommunikation? Was macht eine mscorlib.dll Datei?

Bei meinem Kollegen zb. funktioniert mein Code trotz gleicher Einstellung nicht. Er verwendet das Visual Studio 2015 statt 2013.

1te Frage:

Mein C# Code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            MLApp.MLApp matlab = new MLApp.MLApp();
            matlab.Execute(@"cd C:\Users\z003dukj\Documents\MATLAB\maerz");
            object result = null;
            //string var1 = "Mat.txt"; //CSharp_Schnittstelle\Matlab_Export_dll hier müsste das File sein
            string var1 = @"d C:\Users\z003dukj\Documents\MATLAB\MatlabExport_1";
            // Call the MATLAB function 
            matlab.Feval("maerz27", 1, out result, var1);
            

        }
    }
}

Die resultierende Fehlermeldung:
siehe ua. Anhang

Fehlermeldung:
A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

If there is a handler for this exception, the program may be safely continued.

2te Frage:
Wird eine Matlab Lizenz gezogen, wenn ich eine Matlab Funktion im c# aufrufe die ich vorher mittels "Add Reference" usw. hinzugefügt habe? (.dll-Datei)

matlab.Feval("test_func", 1, out result, var1);

16.835 Beiträge seit 2008
vor 6 Jahren
  1. "Funktioniert nicht" ist keine Fehlermeldung. Bitte auch immer die InnerException mitliefern und in den Error-Tag setzen. (Siehe [Hinweis] Wie poste ich richtig? Punkt 5)
  2. Nur eine Frage pro Thread (Siehe [Hinweis] Wie poste ich richtig? Punkt 1.2)
  3. Code bitte in Tags setzen (Siehe [Hinweis] Wie poste ich richtig? Punkt 6)