3

I have this small app copied from a 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());

When I try to compile it with jsc, I get this error:

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

What's causing this error, and how can I resolve it?

1 Answer 1

8

Import "Accessibility" namespace.

The code compiles using jsc.exe v2.0.50727 and v4.0.30319 when Accessibility namespace is imported.

Without it the compiler generates the following:

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'

OR

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

import Accessibility;

Sign up to request clarification or add additional context in comments.

1 Comment

thanks, i was becoming a bit annoyed by this too..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.