Following information would be useful:
1. In Project properties->Configuration Properties->Build, set "Register for
COM interop" to true. You can use the component in ASPs using
Server.CreateObject("AssemblyName.ClassName")
But it will work only on the development machine. You can use RegAsm to
install it for COM interop on other machines.
You can also look at the entry in oleview. Assembly must be registered in
GAC.
2. If you want to use specific guid, use GuidAttribute on class definition.
3. Follow COM specifications for class name/method name etc. All the
overridden methods are visible to COM clients(e.g. VB/VBScript) with new
names e.g.
class MyComponent() {
public MyMethod() {}
public MyMethod(string s) {}
}
will be exposed to COM clients as:
MyComponent.MyMethod()
MyComponent.MyMethod2(string s)
4. For deployment:
set ur assembly to be installed to GAC directly, it must be signed before
doing so.
Add code->Installer class to ur project. Override Install :
add after base.install
RegistrationServices regsrv = new RegistrationServices();
if (!regsrv.RegisterAssembly(this.GetType().Assembly,
AssemblyRegistrationFlags.SetCodeBase))
throw new InstallException("Failed to register for COM interop -
component not usable in ASP");
Override Uninstall:
add after base.Uninstall
RegistrationServices regsrv = new RegistrationServices();
if (!regsrv.UnregisterAssembly(this.GetType().Assembly))
throw new InstallException("Failed to unregister for com");
Abhijeet Dev