php-windows Digest 16 Jul 2013 16:07:15 -0000 Issue 4113

Topics (messages 31044 through 31044):

Problem trying to use DOTNET class
        31044 by: Peter Facey

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
I can't get

$serial = new DOTNET('System', 'System.IO.Ports.SerialPort');

to work because it always says "PHP Fatal error:  Uncaught exception
'com_exception' with message 'Failed to instantiate .Net object
[CreateInstance] [0x80070002] The system cannot find the file specified." It
does this even if I use a fully qualified assembly name such as

$serial = new DOTNET('System.IO.Ports, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=a8425bc35256e463', 'System.IO.Ports.SerialPort');

Thinking I had got the above info wrong, I asked on the Microsoft .NET forum
but they cannot suggest better info
(see
http://social.msdn.microsoft.com/Forums/vstudio/en-US/683a5e94-50fe-49c3-abd
b-f23856d2f5f0/problem-with-getting-php-to-instantiate-net-object )

Two questions:
1) There is some uncertainty in the PHP manual as to whether I should be
using the DOTNET class or the dotnet_load function. The former only to be
found via the 2 year old comment from Rudi Lippert (see
http://uk3.php.net/manual/en/function.dotnet-load.php )
Which should I use please?
2) Any idea what I am doing wrong?

Fails in PHP 5.3.6 and 5.5.0
I have .NET 2.0, 3.0, 3.5 and 4 installed on my Windows 7 64-bit PC (of
course PHP is running in 32-bit mode).
I have read elsewhere that PHP dotnet doesn't work with .NET v4, hence why I
was trying to use v2.

regards


--- End Message ---

Reply via email to