Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Another alternative is to use COM Interop to create an assembly in .NET that is callable from classic ASP.</p> <p>To create a COM Interop assembly from Visual Studio (e.g. Microsoft Visual C# 2005 Express Edition):</p> <ul> <li>Create a new Class Library project</li> <li><p>Open the project properties</p> <ul> <li>Under Application select Assembly Information... and enable "Make assembly COM-Visible"</li> <li>Under Signing enable Sign the assembly and create or select an existing strong name key file</li> </ul></li> <li><p>Write and build the library</p> <ul> <li>COM Interop classes must have a default constructor and only non-static classes and methods are published</li> </ul></li> <li><p>Copy the .dll to the desired folder/machine</p></li> <li>Register the .dll for COM using RegAsm</li> </ul> <p>For example (adjust as necessary):</p> <pre><code>"C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" "C:\path\to\assembly.dll" /tlb /codebase </code></pre> <ul> <li>Call the assembly from ASP</li> </ul> <p>For example (adjust as necessary):</p> <pre><code>Dim obj, returnValue Set obj = Server.CreateObject("MyProject.MyClass") returnValue = obj.DoSomething(param1, param2) </code></pre> <p>Note:</p> <ul> <li>the assembly must be re-registered via RegAsm when it's updated</li> </ul> <p>See also:</p> <ul> <li><a href="http://msdn.microsoft.com/en-us/library/zsfww439(VS.71).aspx" rel="nofollow noreferrer">Exposing .NET Framework Components to COM (MSDN)</a></li> <li><a href="http://www.codeproject.com/KB/dotnet/dotnetcomponentandasp.aspx" rel="nofollow noreferrer">CodeProject: Call a .NET component from an ASP Page</a></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload