Using Notes from C#.net

I’m trying to get com interop working with C#.net and Lotus Domino objects, but I keep getting a runtime error saying :“COM object with CLSID {29131524-2EED-1069-BF5D-00DD011186B7} is either not valid or not registered.”.

I’ve added a reference to Lotus Domino Objects etc. I’ve tried registering the dll as suggested on this forum, without any success.

However, similar code on the same machine using vb.net runs without error. Anyone managed to get it working with C# at all?

Subject: Using Notes from C#.net

I have, too. Have you tried starting up a Notes Session with something like the following?

// Start a session in Notes

Type t = Type.GetTypeFromProgID(“Notes.NotesSession”);

Object Session = Activator.CreateInstance(t);

Type SessionType = Session.GetType();

Subject: RE: Using Notes from C#.net

Use the Lotus Domino Objects instead and type your variables declaratively. Add a reference, use “using Domino;” and start so:

NotesSession session = new NotesSession();

session.Initialize();

(Intellisense will give you the params and types for new() and Initialize()).

Subject: Using Notes from C#.net

Yes, I have – with no more problems than with VB.NET (notably, a cast problem from the NotesItem doc.GetFirstItem() to a NotesRichTextItem).