Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Trying to reference a DLL (located in the GAC) from a JIT compiled page using codebehind.

Reply
Thread Tools

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

 
 
Jason Kendall
Guest
Posts: n/a
 
      02-01-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Jason Kendall
Guest
Posts: n/a
 
      02-04-2005
<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 Removed)



On Tue, 01 Feb 2005 07:58:26 -0500, Jason Kendall
<(E-Mail Removed)> wrote:

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


 
Reply With Quote
 
 
 
 
Jason Kendall
Guest
Posts: n/a
 
      02-04-2005
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 Removed)




On Tue, 01 Feb 2005 07:58:26 -0500, Jason Kendall
<(E-Mail Removed)> wrote:

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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If I create a page, then it's compiled upon first request, where cani find the compiled code?? lander ASP .Net 5 03-05-2008 04:34 PM
How to determine web reference URL of a compiled asp.net DLL? DBxGlock ASP .Net 1 04-25-2006 05:52 PM
JIT Debugging error when trying to exec app external to ASP.NET =?Utf-8?B?c25pY2tz?= ASP .Net 5 01-23-2006 12:28 PM
g++ compiled C++ code called from gcc compiled C code Klaus Schneider C++ 1 12-02-2004 01:44 PM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments