自动化服务器无法创建对象 [英] Automation server can't create object

查看:157
本文介绍了自动化服务器无法创建对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个C#对象,该对象需要能够从javascript应用程序访问。

I am writing a C# object that I need to be able to access from a javascript application.

var util = new ActiveXObject('Namespace.Class');

但是,当我尝试创建对象时,出现错误消息,异常:自动化服务器可以不会创建对象。我已经为COM互操作注册了该对象,并且对该程序集进行了签名。

However, when I attempt to create the object I get an error saying, "Exception: Automation server can't create object." I have registered the object for COM interop and the assembly is signed.

注意:这不是网页,也不在浏览器中运行。我能够以相同的方式创建其他COM对象,因此我的安全设置已经设置好,并且脚本引擎正在运行。

NOTE: This is NOT a webpage and is NOT being run in the browser. I am able to create other COM objects in this same way, so my security settings are already set, and my script engine is working.

推荐答案

好,我刚接触COM。原来我没有将com visible设置为true。希望这对某人有帮助!

Ok I'm just new to COM. Turns out I did not set com visible to true. Hope this helps someone!

[ComVisible(true)]

这篇关于自动化服务器无法创建对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆