Automation server can't create object

橙三吉。 提交于 2020-01-06 05:35:07

问题


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

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

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.

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.


回答1:


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

[ComVisible(true)]


来源:https://stackoverflow.com/questions/7080734/automation-server-cant-create-object

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!