Pre-compiling

Discussion about the open-source Phalanger [?] project.

Pre-compiling

Postby bseddon@codeplex » March 10th, 2007, 12:18 pm

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
bseddon@codeplex
 
Posts: 13
Joined: January 7th, 2012, 8:52 pm

RE: Pre-compiling

Postby tomasp » March 27th, 2007, 11:45 pm

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.
tomasp
 
Posts: 46
Joined: January 7th, 2012, 8:37 pm

RE: Pre-compiling

Postby bseddon@codeplex » March 28th, 2007, 2:39 pm

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
bseddon@codeplex
 
Posts: 13
Joined: January 7th, 2012, 8:52 pm

RE: Pre-compiling

Postby bseddon@codeplex » May 24th, 2007, 9:31 am

Since upgrading to Beta 4 this has not been a problem for me
bseddon@codeplex
 
Posts: 13
Joined: January 7th, 2012, 8:52 pm


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 14 guests

cron

User Control Panel

Login

Who is online

In total there are 14 users online :: 0 registered, 0 hidden and 14 guests (based on users active over the past 5 minutes)
Most users ever online was 511 on April 27th, 2024, 10:11 pm

Users browsing this forum: No registered users and 14 guests