I am trying to execute a script written in VBScript
, in a C#
class library project
using System.Web.UI; //reference added at top
MSScriptControl script = new ScriptControl();
script.Language = "VBScript";
script.AddObject("Repository", connectToDB.GetRepository);
I get the following compilation error:
Error CS0246: The type or namespace name 'MSScriptControl' could not be found (are you missing a using directive or an assembly reference?)
Any ideas?
I belive
should be
using Microsoft.VisualBasic;
Use this code: