开发者

Automation server can't create object

开发者 https://www.devze.com 2023-03-28 17: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\');

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.


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

[ComVisible(true)]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号