2014-03-31 3 views
0

Visual Studio C# Windows 응용 프로그램에서 Matlab 스크립트를 실행하려고합니다. Matlab 컴파일러를 실행하여 스크립트를 작성하고 dll (tryingLF)을 얻었습니다. 아래는 제가 C#에서 버튼을 클릭 할 때 스크립트를 실행하려고 내 코드는 다음과 같습니다C# Windows 응용 프로그램에서 Matlab 스크립트를 실행할 때 오류가 발생했습니다.

using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
using tryingLF;  //dll 

namespace LinkMatlabandC 
{ 
public partial class Form1 : Form 
{ 

    Class1 linking = null; 

    public Form1() 
    { 
     InitializeComponent(); 
    } 

    private void button1_Click(object sender, EventArgs e) 
    { 
     try 
     { 
      linking = new Class1(); 
      linking.loadForecast(); 
     } 
     catch (Exception ex) 
     { MessageBox.Show(ex.Message); } 

    } 
} 
} 

나는 C# 프로그램을 실행하려고 할 때 그러나, 나는 tryingLF '에 대한'형식 이니셜라는 오류가 발생했습니다. Class1 '이 예외를 던졌습니다. " 왜 이렇게됩니까? 어떤 도움을 많이 주시면 감사하겠습니다! 고맙습니다.

답변

0

ex.InnerException 속성을 확인하십시오. 정확히 유형 초기화 예외의 원인에 대한 자세한 정보가 있어야합니다.

하나의 가능성은 Class1이 일부 stuff이 필요하며 그 중 하나를 찾을 수 없다는 것입니다. 그래서 그것은 미쳐 간다.

관련 문제