rlb.usa
rlb.usa

Reputation: 15043

ASP.NET Trouble importing a DLL

I'm having a lot of trouble importing a DLL to use. I have an aspx page with no code behind, no virtual directories.

All I know about the DLL is it's filename 'GenerateExcel.dll' and namespace 'Xander.Utilities'. How do I import it with either of these

<%@ Assembly Src="./bin/GenerateExcel.dll" %>
<%@ Import Namespace="Xander.Utilities" %>

It's not working. I read the other threads on SO and still having trouble.

alt text http://img406.imageshack.us/img406/8021/62535719.gif

EDIT: I use it like this:

<script runat="server">

        protected void Page_Load(object sender, EventArgs e)
        {
            //...
            Xander.Utilities.ExcelMaker em = new Xander.Utilities.ExcelMaker();
            //...        
        }

Upvotes: 0

Views: 4595

Answers (3)

rlb.usa
rlb.usa

Reputation: 15043

The answer was to do an <%@ Import Namespace="Xander.Utilities" %> and then put the DLL in the root's bin folder.

Upvotes: 1

Noah
Noah

Reputation: 13959

I'm not sure if this will work as I don't have your assembly, but you could try with or without the TagPrefix:

<%@ Register Assembly="GenerateExcel" Namespace="Xander.Utilities" TagPrefix="Util" %>

Upvotes: 2

QueueHammer
QueueHammer

Reputation: 10824

to call a dll from your program you need to include the System.Runtime.InteropServices classes

try:

using System.Runtime.InteropServices 
[DllImport("name.dll")]
private static extern int FunctionNameInDll();

Upvotes: 1

Related Questions