[.net] Error on executing Console.WriteLine in JScript.NET

Started by
3 comments, last by Metzler 19 years, 6 months ago
Ahoi, i am actually experimenting with VsaEngine and JScript.NET. The system works good so far, but there is one problem: When i try to execute my JScript with a Console.WriteLine in it, i get the following error (i try to translate it ;)): "The variable 'Console' has not been defined". I do import "System" and have access to it. Can anybody help me? I'd really appreciate it! Thanks in advance Metzler
Advertisement
Just a Quick Idea try putting System in front of the Console command to see if that works, This will make sure that you have added the referances to the system namespace correctly.
Mykre - BlogVirtual Realm :- XNA News and Resources from Down Under** For those Interested in an Australian XNA User Group Contact me though my site.
I believe you also have to add a reference to it when initializing the Vsa engine. I can't remember how again, but there were a series of articles on Microsoft's site about it.
VSEDebug Visual Studio.NET Add-In. Enhances debugging in ways never thought possible.
I have tried, to put the System in front of it.
The error is now, that he asks, if the assembly-reference is missing. It's not ;) :

import Scriptinterface;import System;class myClass implements IScript{	private var Host : IHost;	function OutputMsg (text : String)	{	        //System.Console.WriteLine("Hallo IM Script!");                var a : int = int(System.Math.PI);                Host.OutputMsg("Hallo vom Script!");	}		function GetHost (host : IHost)	{		Host = host;        }}


This is, what it looks like. I do set the reference to system.dll in my code....
Ok, solved it by "googling" ;)
Console is not defined in system.dll, but in mscorlib.dll...
THX guys!

This topic is closed to new replies.

Advertisement