How to invoke the ASP.NET compiler

J

Joseph Farmer

I want to invoke the ASP.NET compiler in a batch job (part of a debugging
build process). I want to build the ASP.NET assembly from my aspx files. I'm
not talking about the "code" assembly which is built when I run/build my
application which is built from my .cs files. I am after the one which
ASP.NET generates when a page is requested. I want to be able to create the
ASP.NET assembly on demand from a batch job - any ideas how I can do this ?

(I know that the ASP.NET assembly will be built when the page is hit and I
could write a program to hit every page in the app thereby forcing a
compilation but I would prefer to be more clinical than this. Also this
approach generates the assemblies in a pseudo-random location and this isn't
helpful for what I am doing.)

Joseph Farmer
 
B

Bruce Barker

the compiler is standard, vb.net, c sharp of javascript compiler. asp.net
create a batch file for the compile and runs it. this does you little good,
though, becuase asp.net actually parses the aspx page itself and produces
the code passed to the compiler. version 1 has no support for doing this
manually (this feature is added to version 2). you can set the batchsize
(number of pages compiled at once) to a large number to cut down the number
of page hits to compile a site.

note: every appdomain load requires a recompile.


-- bruce (sqlwork.com)
 
J

Juan T. Llibre

Navigate to your .Net Framework directory
and issue a command line like this :

aspnet_compiler -v virtualPath

Substitute *your* virtual path, of course.

You can also precompile to a physical path
and/or add a targetPath parameter

Look up "site precompilation" in the VS.NET documentation.
 

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,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top