Can't Find My Program

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

I am tyring to figure out why a class that I am trying to instatiate can not
be found. I am NOT WORKING WITH PRE_COMPILED code. I am dragging the source
code over and placing the code in a folder. I make the appropriate changes in
my @Page directive to ensure that the program would be compiled on the fly
("src="myProgram.aspx").

All works perfectly fine until I get to one of the pages with instatiates a
"utility" class that I created which is called from a number of the web pages.
I get the message "Compiler Error Message: BC30002: Type 'DataBaseAccess' is
not defined.".

My application is in an APPLICATION folder called "Temp". The utility class
"DataBaseAccess.vb" is in the "Temp" folder. This source is uncompiled
source. I have tried to place the <%@ Assembly Src="DatabaseAccess.vb" %> in
my page directives to see it this would help. No luck.

I have compiled this particular module and placed it in my bin folder and then
my error message changes to the following "Compiler Error Message: BC30182:
Type expected." and it highlights this line of code "Dim Table As New
DataBaseAccess()"

I want to figure out how to get the application to work and have the code
compiled on the fly. What do I need to try now?
 
You need to compile that code before you reference it. ASP.NET will compile
the aspx files on the fly, but it does not compile class libraries or code
behind pages on the fly. Your assembly source will be a dll, and not raw
source.
 
The statment that only "aspx" pages are compiled on the fly is not
accurate. It will compile "aspx.vb" pages if that page is identified in
the @Page directive with the "src" option.

Maybe you meant to say that if your aspx.vb page calls a straight .vb
page that it will not compile the program on the fly. Is that what you
meant?

I find it difficult to accept that some pages will compile on the fly
and others will not. What is the purpose of the "@Assembly" option - it
is suppose to allow you to link to other programs and that has on option
of specifying "src=" which would seem to suggest that it will compile
those programs on the fly if they are specified.
 
Back
Top