0

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(); //... } 

3 Answers 3

2

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" %> 
Sign up to request clarification or add additional context in comments.

3 Comments

I'm pretty sure that should do it. Would have been my answer had you not beaten me to the punch! +1
You might need to register the assembly in your Web.config file, or you could always add a code behind page...
I see that the DLL shows up in your bin directory. Did you add the DLL as a reference?
1

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

Comments

1

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

2 Comments

Which file did you put that line into?
The ASPX page; for this small project there were no codebehinds.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.