Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using windows 8.1, PHP Version 5.6.19 and Visual Studio 2015. I created a dll file and registered it successfully using the command

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe

Now i can see my dll through this path C:\Windows\Microsoft.NET\assembly\GAC_MSIL.

But when I am running my php file, getting this error:

Fatal error: Uncaught exception 'com_exception' with message 'Failed to instantiate .Net object [CreateInstance] [0x80070002] The system cannot find the file specified. ' in C:\xampp\htdocs\PhpProject2\index.php:23 Stack trace: #0 C:\xampp\htdocs\PhpProject2\index.php(23): dotnet->dotnet('ClassLibrary1,V...', 'ClassLibrary1.C...') #1 {main} thrown in C:\xampp\htdocs\PhpProject2\index.php on line 23

It seems that the php file cannot locate the dll in my system. Would you please tell me how to solve the issue?

What I have tried:

here is my PhP code:

$class1 = new DOTNET("ClassLibrary1,"
."Version=1.0.0.0,"
."Culture=neutral,"
."PublicKeyToken=8fede19312ec6e8b"
,"ClassLibrary1.Class1");

echo($class1->SayHello());
Posted
Comments
Richard MacCutchan 11-Apr-16 3:20am    
Er, where is the dll?
Member 11345334 11-Apr-16 5:11am    
at this directory C:\Windows\Microsoft.NET\assembly\GAC_MSIL
Member 11345334 11-Apr-16 5:15am    
I registered my dll successfully in this directory C:\Windows\Microsoft.NET\assembly\GAC_MSIL
Richard MacCutchan 11-Apr-16 6:12am    
PHP says it cannot find it.
Member 11345334 11-Apr-16 7:17am    
Yeah, but how to solve the issue? Any idea?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900