C# COM Class template for Visual Studio .Net 2005

We are writing .Net classes that will have to be used by COM objects. Therefore, we had to mark our objects with GuidAttribute and implement an interface that match every method we want to expose. In VB.NET Project, there is a COM Class which my colleague friend, Doron really like and is missing in C# Project. I decided to make a “C# COM Class” template so here you go:


C# Com Class.zip (7.92 KB)


Install:
Put the zip(don’t extract it!) in: %USERPROFILE%\My Documents\Visual Studio 2005\Templates\ItemTemplates\

Usage:

1). Open a new instance of VS.NET 2005 and create a new C# Class Library Project.
2). Right-Click on the project -> Add -> New Item…
3). Select C# COM Class.



csharpcomclass.gif


4). Now insert a name, let’s say: MyClass.


csharpcomclass_example.gif


* The namespace will be auto’ generated by the project’s default namespace.


Enjoy.

 

Oren Ellenbogen