• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

Use a DLL in ASP page

I'm trying to allow Binary Read/Write operations on an ASP page I have.  I found this MS article (http://support.microsoft.com/kb/193998) describing how to build a VB 5.0+ COM DLL to do it.  I only have VB.NET (2.0) on available, so I built a VB.NET DLL avaible to COM through COM Interop services.  I registered the DLL with .NET's RegAsm program and put it in the GAC with Gacutil.

When I try to create the object on my ASP page, I get this error:
Server object error 'ASP 0177 : 80070002'

Server.CreateObject Failed

/store/image.asp, line 56

80070002

What am I doing wrong here?  I'm attaching code on both the .NET component and the APS page
'.NET Component'
using System;
using System.IO;
 
namespace Netsmith
{
    [ProgId("Netsmith.BinaryFileTools")]
    public class BinaryFileTools
    {
        public BinaryFileTools()
        {
            //Constructor does nothing
        }
 
        public byte[] ReadFile(String fileName)
        {
            FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
            byte[] data = new byte[fs.Length];
            fs.Read(data, 0, (int)fs.Length);
            return data;
        }
    }
}
 
'ASP Page'
Dim BinaryFileTools
Set BinaryFileTools = Server.CreateObject("Netsmith.BinaryFileTools") '<=== failing line'

Open in new window

0
mkosbie
Asked:
mkosbie
  • 2
1 Solution
 
mkosbieAuthor Commented:
THANK YOU! I didn't use /tlb with regasm.  Go figure.
0
 
_Stilgar_Commented:
You're welcome.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now