.net - While trying to passing dotnet object one from another php file , Fatal error: Call to undefined method dotnet:: -


i have project on php , have use dotnet dll written on c# . have call different functions of same object in 2 different php pages. in first page works error in second page. can please me? these example ;

dotnet dll :

namespace firstdotnet {     [comvisible(true)]         public class class1      {        public string samplefunction()        {             return "hello";         }     }  } 

php class file animals.php

class animal{  var $abc;   public function do_it(){     $this->abc = new dotnet("firstdotnet, version=1.0.0.0, culture=neutral, publickeytoken=xxxxxxx", "firstdotnet.class1");   } } 

first php file a.php (this works, output 'hello')

require_once("animals.php"); session_start(); $first_animal = new animal(); $_session["animal"] = $first_animal; $first_animal->do_it(); echo $first_animal->abc->samplefunction(); 

second php file b.php (this doesnt work, output fatal error: call undefined method dotnet::samplefunction())

require_once("animals.php"); session_start(); $animal2 = $_session["animal"]; echo $animal2->abc->samplefunction(); 


Comments