ASP accessing a VB.NET DLL?

Ask a Question related to ASP Components, Design and Development.

  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


    jack Guest

  2. Similar Questions and Discussions

    1. Accessing .NET dll from ASP
      I hope this is the right forum to ask this question. I'm having a problem with accessing a dll I have created with vb.NET 2.0 with ASP. (no...
    2. accessing db on other pc
      I am writing an asp.net webpage. It has some code behind it that uses data from an excel spreadsheet. My problem is that instead of having the excel...
    3. accessing FH9 Help
      When i go to the drop down for help, i get none? nothing happens no help window, the drop down does not appear to work, no access to help. HELP! ...
    4. Accessing an F key
      Hi, Does someone know how can I access an F key using an html link, javascript, form object. I need to open a full screen window (like...
    5. ASP.NET: Accessing a Tag with C#
      Hi, IN ASP.NET PAGE I HAVE DEFINED THE DIV TAG AS FOLLOWS:I want to access the value in the code behind(c#) . <div align="left" autopostback...
  3. #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" <jack@mrolinux.com> wrote in message
    news:OMK6grPfEHA.2812@tk2msftngp13.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

  4. #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

Posting Permissions

  • You may not post new threads
  • You may 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