Making your code a script's referenced assembly

Started by
0 comments, last by luke2 16 years, 11 months ago
Alrighty, I've been messing with CodeDom lately and it looks to be very promising for scripting. Here is my problem: script file

using System;
using System.Windows.Forms;
using DomTest; //The namespace where class script should be...

class test
{
	public static script init()
	{
	        script data = new script(); 
		data.x = -1; 
		return data; 
	} 
}
Now, Whenever I try to invoke init I get an exception. Currently I am trying to pass the script the reference which it needs by this method, also I am using C++/CLI to maintain inter language capabilities. (compilerparamters^) params->ReferencedAssemblies->Add( "DomTest.script" ); //I figure this string here is the issue. the script class is defined as:

namespace DomTest
{
    ref class script
    {
    public: 
	int x; 
    };
}
I can give the code access to 'official' namespaces like System by params->ReferencedAssemblies->Add( "System.dll" ); However, my code is in an exe (although, since I am making a library, it will be released as a .lib) So, how can I give the script file access to datatypes defined in my code?
Advertisement
Surely someone knows how to make your code a script's reference?

This topic is closed to new replies.

Advertisement