I created a simple test assemby in VB.Net. I put it and its supporting files in the bin/debug directory in c:\junk.

I then tried this PHP code:

<?php
$obj = new DOTNET("C:\junk\ClassLibrary1.dll", "Class1");
echo $obj->DoSomething();
?>

DoSomething returns a string of text.

Here's the VB.Net code:

Public Class Class1
Public Function DoSomething() As String
Return ("Hello there")
End Function
End Class

DOTNET is described in the COM documentation for PHP. The example there uses the assembly mscorlib. I am looking at how to specify the name of the assembly.

Does is have to be installed in the GAC? Can't just be in a normal directory?

Thanks.

There is very little help I see out on the web where people have used this vs. plain COM.

I suppose I can register it for COM interop and just use the COM access in PHP.

But then that makes me wonder how DOTNET was intended to be used ...

    a month later

    I have exactly the same problem. .NET should be able to function without GAC and it makes no sense to place your assembly in to GAC if you intend to use it only in one PHP script (for example).

    I suppose your code "$obj = new DOTNET("C:\junk\ClassLibrary1.dll", "Class1");" returns an error? I have a strong feeling that php dotnet class only looks into GAC but nobody was able to tell me exactly how it works so far...

    Do you have any news on this subject?

    P.S.: Excuse my English, please. :quiet:

      I haven't received or found any good information on this topic. I ended up just using COM for now. All I can assume is that it's mainly meant to give access to standard Microsoft .Net assemblies.

        Write a Reply...