Trying to reference a DLL (located in the GAC) from a JIT compiled page using codebehind.

J

Jason Kendall

I've got a simple report that I'm building. This is just a single web
page. It uses a custom DLL that I've built as an interface to my
database. When I use th page within an ASP.Net project, in Visual
Studio, I can set a reference to my DLL, Import the namespace, and
everything works perfectly.

However, when I convert the page to a JIT scenario so that I can
publish both the .ASPX page and the associated .VB file and not have
to deploy a compiled DLL for this one simple report, I get the error:

BC30466: Namespace or type 'Data' for the Imports 'MyCompany.Data'
cannot be found.

This looks like the compiler has no reference to the DLL to link in.
I would prefer to do this at the page level, but I'll do it in the
web.config too, if necessary. I've been all over Google and MSDN and
just can't seem to find anything that tells me how to add the
reference outside of Visual Studio.

Thanks!

-Jason Kendall
(e-mail address removed)
 
J

Jason Kendall

<bump>

Someone's got to have done this before. Surely I don't need to
compile my on lonely report into a DLL just to be able to reference an
external DLL in the GAC.

-Jason Kendall
(e-mail address removed)
 
J

Jason Kendall

I finally found the answer for myself, which I will provide below:

All I needed to do was to add a web.config in the folder containing my
JIT compiled report and add an "assemblies" section specifying to
"add" my assembly using the information described in the GAC.

Nothing could be easier and I have all the benefits I had hoped to
have. It's so easy that I'm surprised that none of the local experts
could solve this one.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="false">
<assemblies>
<add assembly="MyCompany.Data,
Version=1.0.4.0, Culture=neutral, PublicKeyToken=af1d58a5db022a2c" />
</assemblies>
</compilation>
</system.web>
</configuration>


Cheers!

-Jason Kendall
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top