.NET Class and Classic ASP

M

Matt

I am in the process of creating a security control object in VB.NET. This
object will be utilized from classic ASP (Asp 2.0) applications that reside
on our Intranet (as well as ASP.NET pages as they are developed). What is
the best way to access this object from my classic ASP pages? Based on this,
what is the Visual Studio 2005 project type that I want to select?



With VB 6, I would create .dll and register it on the web server. Is this
still the case with .NET? I am unsure if I just compile the application on
the web server if I will be able to access the classes from my classic ASP
pages. Any examples our links to demonstrations would help.



Thank you in advance.
 
L

Luke Zhang [MSFT]

In VS.NET, you can 'expose' .NET objects as COM components to COM
clients, by checking the "make assembly COM-visible" option in Assembly
information dialog (Project Properties). Here is a sample to create a COM+
component in VB.NET, which can be used in both of ASP.NET and ASP:

http://support.microsoft.com/default.aspx?scid=kb;en-us;315707

Also, you can register a .NET component for COM client usage by a tool
named "regasm.exe":

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrfassemblyregistrationtoolregasmexe.asp

Regards,

Luke Zhang
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.)
 
M

Matt

As a follow up to this, I had to place the dll into the Windows\system32
folder on the server and run regasm with the /codebase switch in order to
access the object from an ASP page. When I placed the dll anywhere else and
registered it I could not create the object with Server.CreateObject from my
ASP page.



regasm C:\Windows\System32\mnaSecurityControl.dll /codebase
 
L

Luke Zhang [MSFT]

You also can create a .NET assemmbly with strong name, and put it in GAC.
And then register it with regasm.exe.

Regards,

Luke Zhang
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.)
 

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