gpt4 book ai didi

.net - 如何解决 JScript.NET 程序集引用错误 JS1259?

转载 作者:行者123 更新时间:2023-12-02 10:40:54 25 4
gpt4 key购买 nike

我从 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.50727for Microsoft (R) .NET Framework version 2.0.50727Copyright (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.30319for Microsoft (R) .NET Framework version 4.0.30319Copyright (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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com