public class ZYVBScriptEngine : Microsoft.VisualBasic.Vsa.VsaEngine{
//其他
public ZYVBScriptEngine() //每次运行到构造函数这里就报错。。
//“RootMoniker”引发 了“System.Runtime.InteropServices.COMException”类型的异常
{
// 初始化脚本引擎
 this.RootMoniker = "zyinc://ZYTextDocument//script";
 this.Site = myVsaSite;
 this.InitNew();
 this.RootNamespace = "ZYTextDocumentLib";
 this.GenerateDebugInfo = true;
 myVsaSite.EventObject = null;
 
 
 // 添加标准引用库
 AddRefrence("system.dll");
 AddRefrence("mscorlib.dll");
 AddRefrence("system.drawing.dll");
 AddRefrence("system.xml.dll");
 AddRefrence("system.data.dll");
 AddRefrence("system.windows.forms.dll");
 AddRefrence("Microsoft.VisualBasic.dll");
 //AddRefrence(System.Reflection.Assembly.GetAssembly( typeof(ZYTextDocument)).GetName().FullName );// . .Location);
// 添加全局对象
//其他
}
}
试了好多方法 ,最后在网上看到说 改为X86的配置平台就好了。