Module Not Found


Jim Heavey

I am trying to figure out the @Assembly directive.

I have an application which uses "codebehind" and only
uses source code, so I
am using the "src=" option of the @Page directive. So I
have something that
looks like the following:

ASPX Files ASPX.VB Files
Page1.aspx Page1.aspx.vb
Page2.aspx Page2.aspx.vb
Page3.aspx Page3.aspx.vb

Now all of these three pages have a common program, let's
call it "Common.vb"
which is called from Page1.aspx.vb, Page2.aspx.vb,

When I run using the @Page src="Pag1.aspx.vb"
inherits="Page1", when
Page1.aspx.vb instatiates the "Common.vb" I get a compile
error indicating
that the class can not be found.

If I copy "Common.vb" and append it to "Page1.aspx.vb"...
then no problem, it
works just fine.

I am trying to find a way to enable these pages to
find "Common.vb" without me
having to copy the source into each of these pages.

I have taken to "Common.vb" and created a seperate
project, and compiled it
and placed the code in the "bin" folder, but still not

Looking at the @Assembly option, it would appear to me
that this may allow the
assembly to be found, but no matter what I put into this
directive, even
garbage, it has not effect. It has a "src=" option which
indicates that the
specified program will be compiled on the fly.

So any ideas as to what I need to do to enable the program
to be found and
compiled on the fly? Or for that matter, found in
the "bin" folder? Although
I believe it will look in the "Bin" folder for
the "folder" which is
identified as an "application folder" and unfortuneatly
the folder that I am
executing from is not an application folder and nor do I
have access to the
folder which is the application folder to place my
compiled program into.

Your assistance would be greatly appreciated!!!!!!!!!!!



Stephan Bour

If you want to use classes that are part of a compiled assembly you need an
Import declaration at the top of your aspx page, as opposed to Inherits:
<%@ Import Namespace="MyComponent" %>

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