我正在尝试编译此处列出的程序:
http://www.webreference.com/js/column117/index.html
但是,每次尝试我都会收到错误:
错误JS1259:引用的程序集 取决于另一个组件 未引用或无法找到
我检查过,据我所知,我已经为所导入的库提供了所有DLL文件。发生了什么事?
有没有办法获得有关哪个库缺少哪个类或反之亦然的更详细信息?
答案 0 :(得分:4)
似乎我还需要导入辅助功能,以便它可以使用新版本。一个更详细的错误消息本来不错。 :(
但是当我到达“private var myData:DataTable”时,我现在在这个脚本中遇到了同样的错误。部分:
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,因为它会产生实际有用的详细错误。如果需要,您可以随时切换到最终版本的更新版本。这就解决了我的问题。