Use a DLL in ASP page

Posted on 2008-11-12
Last Modified: 2012-08-13
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

Question by:mkosbie
    LVL 14

    Accepted Solution

    LVL 8

    Author Closing Comment

    THANK YOU! I didn't use /tlb with regasm.  Go figure.
    LVL 14

    Expert Comment

    You're welcome.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now