|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Classic ASP pages and DOTNET assembliesHi
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
Show quote
"J055" <j055@newsgroups.nospam> wrote in message Yes you can do this. It's one of the common migration strategies for news:%23UPcJSCgGHA.3900@TK2MSFTNGP05.phx.gbl... > 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. > ASP/COM applications. David J055 wrote:
> Hi Yes. You need to strong-name your .NET assembly, register it with > > Is it possible to create a COM wrapper around a DOTNET DLL so that it > can be accessed from a .asp web page? 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.) |
|||||||||||||||||||||||