Page 1 of 1

Pre-compiling

PostPosted: March 10th, 2007, 12:18 pm
by bseddon@codeplex
Where can I find documentation on how to pre-compile scripts for use with ASP.NET? I've compiled my scripts to a WebPages.dll assembly using the compiler. However the LoadPrecompiledAssemblyNoLock() method fails complaining that the assembly is not marked with a ScriptAttribute and so cannot be watched (which is correct, I'm not interested in watching if the scripts are pre-compiled).

Here's my command line:

phpc /target:web /debug- /config:Web.config /pure- /recurse:server

('server' is the folder containing the PHP scripts)

I'm using the same config file for compilation that is used successfully to run the application when not pre-compiled.


Thanks

RE: Pre-compiling

PostPosted: March 27th, 2007, 11:45 pm
by tomasp
Hi,
if you compile PHP application using 'phpc' as you described, Phalanger will load WebPages.dll automatically (LoadPrecompiledAssemblyNoLock is internal Phalanger function that is not intended to be called from your code).

To verify that it really loaded precompiled file, you can look in the ASP.NET Temporary Files (in C:\Windows\Microsoft.NET\Framework\v2.0.xxx\) directory, because this is the place where compiled assemblies are stored.

RE: Pre-compiling

PostPosted: March 28th, 2007, 2:39 pm
by bseddon@codeplex
Hi, thanks for your response.

I've not explained myself well because you've misunderstood me. My code doesn't call the LoadPrecompiledAssemblyNoLock method. I've debugged through the Phalanger source code in Visual Studio and Phalanger fails in this method complaining theScriptAttribute is not available.

If I let phalanger compile the PHP scripts and create its own webpages.dll these work OK. However I have an application with many scripts and I want them all to be compiled. Phalanger seems to create a WebPages.dll file for each script but this is not desireable. So I've compiled the scripts using phpc to create one, composite webpages.dll. When the .dll is placed in the bin folder, Phalanger finds it, loads it as an internal assembly but then fails for the reason mentioned earlier in this post. Is there someway I can mark the composite Webpages.dll with the required ScriptAttribute?

Bill Seddon

RE: Pre-compiling

PostPosted: May 24th, 2007, 9:31 am
by bseddon@codeplex
Since upgrading to Beta 4 this has not been a problem for me