Assembly not found

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

Assembly not found

Postby ddwyer@codeplex » June 5th, 2007, 10:17 pm

I am a beginner to Phlanger, so I may be doing something very simple wrong. I am attempting to use an assembly to automate IE called WatiN (http://watin.sourceforge.net) and when I add the reference and compile, I receive an assembly not found message, even though I chose the reference by browsing.
ddwyer@codeplex
 
Posts: 3
Joined: January 7th, 2012, 8:55 pm

RE: Assembly not found

Postby bseddon@codeplex » June 8th, 2007, 9:41 pm

When you say "I add a reference and compile" are you talking about compiling some PHP scripts using phpc or are you re-compiling the PHP source code? If you are using phpc then the reference needs to go into the configuration file withing the <classLibrary> element. The assembly needs to be in the folder specified in Libraries element of the <Paths> element.
bseddon@codeplex
 
Posts: 13
Joined: January 7th, 2012, 8:52 pm

RE: Assembly not found

Postby ddwyer@codeplex » June 8th, 2007, 10:30 pm

Sorry, let me start again. Here are my steps:
1. I open a phlanger console app in the Visual Studio 2005 IDE and compile it (success)
2. I add the assembly WatiN (http://watin.sourceforge.net) to the project by browsing to the assembly and adding
3. I compile it and it fails with an assembly not found message

You mention adding the reference to the assembly (c:\program files\watin\build\watin.core.dll in this case), but I am not sure about the structure. Is there documentation of the config file format somewhere that I missed?
ddwyer@codeplex
 
Posts: 3
Joined: January 7th, 2012, 8:55 pm

RE: Assembly not found

Postby bseddon@codeplex » June 9th, 2007, 9:09 pm

Yes, if you want to use methods from an assembly (such as the one you mention) from PHP code you must add the assembly to the configuration file. You can find an example of the possible entries in the configuration file here:http://www.codeplex.com/Phalanger/SourceControl/FileView.aspx?itemId=21946&changeSetId=18548.
bseddon@codeplex
 
Posts: 13
Joined: January 7th, 2012, 8:52 pm

RE: Assembly not found

Postby ddwyer@codeplex » June 10th, 2007, 3:48 pm

Thanks for the pointer-- that should probably be referenced in the "Documentation" section.
What I am not seeing is an example of adding an assembly not in the GAC. Any ideas?
ddwyer@codeplex
 
Posts: 3
Joined: January 7th, 2012, 8:55 pm

RE: Assembly not found

Postby bseddon@codeplex » June 10th, 2007, 4:40 pm

Any assembly containing namespaces you want to reference in PHP code, including those in the GAC, have to appear within the <classLibrary> element. If the assembly is not reference within this element, you can't use its methods in PHP script. If you write PHP you will know that extensions have to be explicitly referenced in php.ini. The <classLibrary> element fullfils the same role as theextensions seciton on php.ini.

There are no exceptions. I believe that in some circumstance it may be possible to reference an assembly by name (and include a path) but Phalanger is subject to the strict assembly loading constraints imposed by .NET 2.0. In other words if the assembly is not within the application's scope (generally a sub-folder of the application or the GAC) then .NET will refuse to load it and generate a security exception.
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 40 guests

cron

User Control Panel

Login

Who is online

In total there are 40 users online :: 0 registered, 0 hidden and 40 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 40 guests