Problem trying to use DOTNET class

From: Date: Tue, 16 Jul 2013 16:07:13 +0000
Subject: Problem trying to use DOTNET class
Groups: php.windows 
Request: Send a blank email to php-windows+get-31044@lists.php.net to get a copy of this 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

« previous php.windows (#31044) next »