namespace MyDll { public class TestIndex { public string Sathish(string a) { a += "..This is .Net"; return a; } } } <pre> and then i registered the dll in assembly My php file name is Test.php and it should Contain below coding, <pre lang="PHP"> <?php $test = new DOTNET("MyDll,Version=1.0.0.0,Culture=neutral,PublicKeyToken=0baa6d3271b1f300","MyDll.TestIndex"); echo($test->Sathish("From Php..")); ?>
Fatal error: Uncaught exception 'com_exception' with message 'Failed to instantiate .Net object [Unwrapped, QI for IDispatch] [0x80004002] No such interface supported ' in C:\xampp\htdocs\Test.php:2 Stack trace: #0 C:\xampp\htdocs\Test.php(2): dotnet->dotnet('MyDll,Version=...', 'MyDll.TestInde...') #1 {main} thrown in C:\xampp\htdocs\Test.php on line 2
using System.Runtime.InteropServices; // Name Space namespace MyDll { [ComVisible(true)] // using ComVisible only we can access the dll public class TestIndex { public string Sathish(string a) { a += "..This is .Net"; return a; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)