Register .NET Dll for classic asp

K

Kai Gloth

Hi,

I created a .NET ClassLibrary written in C#
Could a asp classic application use this dll?
If it could, what would I do to register them? Regsvr32 returns:
"createThumb.dll loaded, but DllRegisterServer-Startpoint could not found"
( translated from german error message).

thanks in advance
 
A

Abhijeet Dev

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top