I have a C# project that exports part of its API into COM using regasm. I need the API to include features that don't seem to be well documented. These are:
[hidden] - I need to mark certain properties/methods hidden in COM. I realize that no such concept exists in C#, but it does on COM.
[helpcontext] - How do I support context-sensitive help This includes helpcontext, helpstring and helpfile.
Note that this is not a graphical API or GUI control. It is a library implementing a set of interfaces. Searches around MSDN and Google have revealed no answers so far.

Need CCW to support [hidden] and helpcontext
Tryin2Bgood
If you define the interfaces in IDL, you can import the typelib (with Tlbimp or VS Add Reference) to an interop assembly you can use from your C# code. That way you only have a single primary definition, and if that changes it will be reflected in the interop assembly.
LiveGadgets
I appreciate that, but it doesn't really help. If I did this, I would have to maintain two distinct definitions of my API that must always be in sync with one another. I am providing technology for a staff of software developers that will each be contributing their own API's to our product. It is very desirable to minimize the overhead each developer must managed for their project. What you suggest will lead to a maintainability problem and be a common source of bugs.
Jeroen Alblas
The typelib doesn't have to be produced by Tlbexp or Regasm. You can write your own in IDL and compile with Midl, and include any features you want.
zlatkoc
That will work, but it's not pretty. I guess the real answer it that it can't be done in C# alone. How does one provide F1 help for a pure .net API I've seen documentation on how to set this up for a Windows application, but not for an individual library.
Thanks for your help.
CsNetworks
Doesn't VS register it for you if you browse to the TLB file from the Browse tab in the Add Reference dialog If not, you can easily create your own Regtlib like tool. It's just a thin wrapper for LoadTypeLibEx(REGKIND_REGISTER).
Another way is to open the typelib in Oleview.exe (from the command line and only specifying the file name without the path). It's a side effect of Oleview using the LoadTypeLib API.
Nadav Popplewell
I like using MIDL too. Not just to make it hard to change the COM interfaces but also to allow MSFT interfaces to be used that are only available in an IDL file. Unfortunately, you can't set a reference to the .tlb it generates unless the type library is registered. I use regtlib.exe for that but that tool is no longer shipped as of late. How do you do it