Assembly not found
6 posts
• Page 1 of 1
Assembly not found
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
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
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?
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
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
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?
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
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.
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
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 40 guests