@Page directive's "src=" attribute and referenceing a DLL....

K

Kevin Buchan

I have a web page that I want to JIT compile using the 'src' attribute
in the Page directive.

I've done this many times and life has normally been great, as a
result.

However, I find myself in need of an assembly installed in the GAC of
the destination server. Everything works fine if I add a reference to
the DLL and precompile my page. However, when I change the page
directive from 'CodeBehind=' to 'src=', then the namespace 'Imports'
line in my codebehind page generates an error.

I was under the impression that the physical Assembly reference was
only necessary during development of the application and that, at run
time, the DLL would be found in the GAC and loaded, appropriately.

Clearly, I missed something....

So, my question is: How do I identify the assembly that my web page
needs to reference so that the 'Imports TroutmanSanders.Data' line
doesn't fail?

Thanks so much!

-Kevin Buchan

-Kevin Buchan
(e-mail address removed)
 
C

Cowboy \(Gregory A. Beamer\)

Overall, I would shy away from dynamic source compilation, for a variety of
reasons. The advise changes a bit with Whidbey, but the src="" does not
really save you that much and adds a lot of bugs into the system (as you
have gathered). There may be a project where this is the optimal way to
approach the problem, but I have not found one yet.

Having said that, you can specify particular assemblies in the web.config
file, which will work well with assemblies in the GAC. You will have to make
sure you point to the correct version of the GAC-ed assembly, or have the
config set to use it or any newer version.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
K

Kevin Buchan

Thank you for your reply.

As good example of a time with using the 'src=' attribute is a great
one, consider my situation.
I am building a report that is not part of any project. There seems
to be a low liklihood of another related report to ever be required.
For this reason, I would really rather not have to create a solution
and project and have to compile and deploy a DLL just so that I can
take advantage of a code behind page during development.

I am able to use the .Net environment to build and test my page then,
with a couple minor changes, I can deploy it with no dependencies
besides the .aspx and .vb files.


-Kevin Buchan
(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

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top