How to make properties visible to COM in a .NET DLL (Methods DO work)

后端 未结 1 925
时光说笑
时光说笑 2020-12-12 01:25

Solved, see comments!

I have a simple .NET DLL written in c#.

In asp-classic or VB.NET i can create the object and call a member fun

相关标签:
1条回答
  • 2020-12-12 02:10

    Properties must be included in the interface definition to make them visible to COM.

    Example:

    [Guid("... some GUID ...")]
    [ComVisible(true)]
    public interface MyClassInterface
    {
        string MyProperty { get; set; }
        bool MyMethod();
    }
    
    0 讨论(0)
提交回复
热议问题