Classic ASP pages and DOTNET assemblies

  • Thread starter Thread starter J055
  • Start date Start date
J

J055

Hi

Is it possible to create a COM wrapper around a DOTNET DLL so that it can be
accessed from a .asp web page?

e.g.

Set wrappedDotNetObj = Server.CreateObject("DOTNET.MyObject")

It's not practical at the moment to convert old asp pages to aspx one's but
it would be nice to start writing assemblies in dotnet which can be used in
Classic ASP pages now without rewritting the components later when we can
start using ASP.NET.

It would be nice to know if anyone else is or has done this too.

Thanks
Andrew
 
J055 said:
Hi

Is it possible to create a COM wrapper around a DOTNET DLL so that it can
be accessed from a .asp web page?

e.g.

Set wrappedDotNetObj = Server.CreateObject("DOTNET.MyObject")

It's not practical at the moment to convert old asp pages to aspx one's
but it would be nice to start writing assemblies in dotnet which can be
used in Classic ASP pages now without rewritting the components later when
we can start using ASP.NET.

It would be nice to know if anyone else is or has done this too.

Yes you can do this. It's one of the common migration strategies for
ASP/COM applications.

David
 
J055 said:
Hi

Is it possible to create a COM wrapper around a DOTNET DLL so that it
can be accessed from a .asp web page?

Yes. You need to strong-name your .NET assembly, register it with
regasm.exe and put it in the GAC for a traditional ASP page to be able to
load it.

-cd
 
Hi Andrew,

As for classic ASP page, it uses script engine which could utilize COM
components. And .net framework provide the ability to expose managed
assembly as COM objects. Therefore, you can simply write your custom .net
assemblies and register them as COM components(so that they can be used in
your classic ASP pages). Here are some web articles discussing on using
.net assemblies in classic ASP pages:

#Consume a .NET Assembly from a classic ASP page.
http://weblogs.asp.net/dneimke/archive/2004/01/31/65330.aspx

#Understanding Classic COM Interoperability With .NET Applications
http://www.codeproject.com/dotnet/cominterop.asp

In addition, you can find complete information about .net COM interop in
the MSDN library:

#Exposing .NET Framework Components to COM
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconexposingnetframewo
rkcomponentstocom.asp?frame=true

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top