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 ( 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


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
    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

Who is Participating?
mkosbieAuthor Commented:
THANK YOU! I didn't use /tlb with regasm.  Go figure.
You're welcome.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.