2011-01-27 30 views
4

我試圖編譯下面列出的程序:的JScript .NET錯誤

http://www.webreference.com/js/column117/index.html

然而,每次我試圖我得到一個錯誤:

error JS1259: A referenced assembly depends on another assembly that is not referenced or could not be found

我檢查,我有盡我所知可以導入所有庫的所有DLL文件。發生什麼事?

有沒有辦法獲得更詳細的信息,哪些庫缺少哪個類或反之亦然?

+0

好吧,好像是一個是起訴與安裝的.NET Framework的版本。我試着用舊版本的編譯器,它工作正常。任何人都知道我可以在哪裏找到關於如何將腳本更新到最新框架的信息? – posfan12 2011-01-27 09:07:32

回答

4

似乎我還需要導入輔助功能才能使用新版本。更詳細的錯誤信息本來不錯。 :(

但現在我得到同樣的錯誤在該腳本時,得到了「私人VAR myData的:數據表;」部分:

import System; 
import System.Windows.Forms; 
//import System.ComponentModel; 
import System.Drawing; 
import Accessibility; 
import System.Data; 
import System.Data.SqlClient; 


package ResizeMe 
{ 
class PanelForm extends System.Windows.Forms.Form 
{ 
    private var panel1: Panel; 
    private var label1: Label; 
    private var myDataForm: DataGridView; 
    private var myData: DataTable; // !!! 
    private var connectionString: String; 
    private var selectCommand: String; 
    private var dataAdapter: SqlDataAdapter; 
    private var commandBuilder: SqlCommandBuilder; 

    function PanelForm() 
    { 
    this.Text= "Anchoring Demo: Resize Me"; 



    try 
    { 
    selectCommand = "SELECT * FROM dbo.Deities"; 
    connectionString = "Integrated Security=SSPI;Persist Security Info=False;" + 
    "Initial Catalog=protos;Data Source=localhost" 

    dataAdapter = new SqlDataAdapter(selectCommand, connectionString); 
    commandBuilder = new SqlCommandBuilder(dataAdapter); 

// myData = new DataTable(); 
// myData.Locale = System.Globalization.CultureInfo.InvariantCulture; 
// dataAdapter.Fill(myData);  // !!! 

// myDataForm = new DataGridView(); 
// myDataForm.DataSource = myData; 
// myDataForm.Location= new Point(100,100); 
// myDataForm.Size= new System.Drawing.Size(100,100); 
    } 
    catch (e:SqlException) 
    { 
// MessageBox.Show("To run this example, replace the value of the " + 
// "connectionString variable with a connection string that is " + 
// "valid for your system."); 
    } 



    label1= new Label;  
    label1.Location= new Point(10,10); 
    label1.Size= new System.Drawing.Size(80,20); 
    label1.Name= "label1"; 
    label1.Text= "This is a Label"; 

    panel1= new Panel; 
    panel1.Location= new Point(0,0); 
    panel1.Size= new System.Drawing.Size(300,300); 
    panel1.Name= "This is a Panel"; 
    panel1.Anchor= AnchorStyles.Top | AnchorStyles.Left; 

    panel1.Controls.Add(label1); 
    panel1.Controls.Add(myDataForm); 

    this.Controls.Add(panel1); 
    } 
} 
} 

Application.Run(new ResizeMe.PanelForm()); 

任何線索什麼我失蹤

僅供參考,在開發過程中使用.NET Framework v2.0.50727附帶的jsc.exe,因爲它會產生實際上非常有用的詳細錯誤。如果需要,您可以隨時切換到最新版本的較新版本。什麼解決了我的問題

+0

在我的情況下,事實證明,當我使用v4.0.30319 JSC編譯我的代碼時,我會收到此錯誤,但是當我前往v2.0.50727,就像您提到的更好的錯誤消息解決了我的問題。 我可能有用舊版本編譯的.dll文件,並且正在編譯新版本的.exe文件,而不是抱怨不兼容的版本,它告訴我它找不到.dll 希望可以幫助某人。 – Dan 2013-08-23 19:23:35

相關問題