Professional Web Applications Themes

ASP accessing a VB.NET DLL? - ASP Components

Hello, I have a VB.NET DLL and want to access it via ASP. Is this possable? Dose anyone have an example? Thanks, Jack...

Sponsored Links
  1. #1

    Default ASP accessing a VB.NET DLL?

    Hello,

    I have a VB.NET DLL and want to access it via ASP. Is this possable? Dose
    anyone have an example?

    Thanks,

    Jack


    Sponsored Links
    jack Guest

  2. #2

    Default Re: ASP accessing a VB.NET DLL?

    Probably better off asking this in a .net group, but anyway.

    Create a new class library project called COMInteropTest and rename class1
    to be TestClass. Add a reference to System.Runtime.Remoting. Code for
    class looks like;

    Imports System.Runtime.InteropServices

    <InterfaceType(ComInterfaceType.InterfaceIsDual) > _
    Interface IMyInterface
    Function SayHello() As String
    End Interface

    <ProgId("COMInteropTest.TestClass")> _
    Public Class TestClass
    Implements IMyInterface

    Public Sub New()

    End Sub

    Public Function SayHello() As String Implements IMyInterface.SayHello
    SayHello = "Hello"
    End Function
    End Class

    Open a .net command prompt (or a normal command prompt and navigate to your
    ..net install folder) and type;

    sn -k c:\strongname.snk

    This will create a strong name file in your c:\ folder. Update the
    AssemblyInfo.vb file to use this strong name like so;

    <Assembly: AssemblyTitle("")>
    <Assembly: AssemblyDescription("")>
    <Assembly: AssemblyCompany("")>
    <Assembly: AssemblyProduct("")>
    <Assembly: AssemblyCopyright("")>
    <Assembly: AssemblyTrademark("")>
    <Assembly: CLSCompliant(True)>
    <Assembly: AssemblyKeyFile("c:\strongname.snk")> ' <-- Add this

    Build your dll and from your command prompt

    gacutil /if cominteroptest.dll

    this will add your assembly to the GAC. Now register it as a COM object by;

    regasm cominteroptest.dll /tlb:cominteroptest.tlb

    Phew. Now you can use it as normal

    set obj = CreateObject("COMInteropTest.TestClass")
    msgbox obj.SayHello
    set obj = nothing


    "jack" <jackmrolinux.com> wrote in message
    news:OMK6grPfEHA.2812tk2msftngp13.phx.gbl...
    > Hello,
    >
    > I have a VB.NET DLL and want to access it via ASP. Is this possable?
    Dose
    > anyone have an example?
    >
    > Thanks,
    >
    > Jack
    >
    >

    Adrian Forbes [ASP MVP] Guest

  3. #3

    Red face Re: ASP accessing a VB.NET DLL?

    yes we can , we just need to browse and see in debug or release folder to get dll
    and then add this reference to ur project or else simply copy dll of previous appln to current application 's bin folder
    Kena Guest

Similar Threads

  1. Accessing .NET dll from ASP
    By T McDonald in forum ASP Components
    Replies: 1
    Last Post: March 14th, 05:20 PM
  2. accessing db on other pc
    By Neil in forum ASP Database
    Replies: 2
    Last Post: May 14th, 10:42 PM
  3. accessing FH9 Help
    By happycanyon webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 2
    Last Post: February 5th, 01:19 AM
  4. Accessing an F key
    By yoram in forum PERL Miscellaneous
    Replies: 3
    Last Post: August 18th, 02:01 PM
  5. ASP.NET: Accessing a Tag with C#
    By msnews.microsoft.com in forum ASP.NET General
    Replies: 0
    Last Post: July 22nd, 12:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139