我从 book 复制了这个小应用程序:
import System;
import System.Drawing;
import System.Windows.Forms;
public class BasicForm extends Form
{
public function BasicForm()
{
InitializeComponent();
}
private function InitializeComponent() : void
{
this.Text = "Basic Windows Forms";
this.Height = 400;
this.Width = 500;
this.WindowState = FormWindowState.Normal;
this.StartPosition = FormStartPosition.CenterScreen;
}
public STAThreadAttribute() static function Main(Args:String[]) : void
{
Application.Run(new BasicForm());
}
}
BasicForm.Main(Environment.GetCommandLineArgs());
当我尝试用 jsc 编译它时,我得到了这个错误:
error JS1259: A referenced assembly depends on another assembly that is not referenced or could not be found
是什么导致了这个错误,我该如何解决?
最佳答案
导入“辅助功能”命名空间。
代码编译时使用 jsc.exe v2.0.50727 和 v4.0.30319 可访问性命名空间已导入。
没有它,编译器会生成以下内容:
Microsoft (R) JScript Compiler version 8.00.50727 for Microsoft (R) .NET Framework version 2.0.50727 Copyright (C) Microsoft Corporation 1996-2005. All rights reserved. error JS1259: A referenced assembly requires you to also reference 'Accessibility, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
或
Microsoft (R) JScript Compiler version 10.00.30319 for Microsoft (R) .NET Framework version 4.0.30319 Copyright (C) Microsoft Corporation. All rights reserved. error JS1259: A referenced assembly depends on another assembly that is not referenced or could not be found
导入辅助功能;
关于.net - 如何解决 JScript.NET 程序集引用错误 JS1259?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11677633/