0

C# から PHP で定義されたメソッドを使用したい。Phalanger を使用して PHP ファイルから .dll を作成し (ピュア モードを使用)、それを参照としてプロジェクトに追加しました。

dll を正常に呼び出すことができますが、作成しようとしている PhPObject が null であるため、正しいパラメーターを渡すことができません。

ここに私が実行しているコードがあります: http://i.imgur.com/6JGqdKN.png

これは、PhPObject を作成するためにコードを使用した例です: http://wiki.php-compiler.net/Code_Samples/Standard_mode_interoperability

Phalanger が正しくインストールされていない可能性があると思いますが、エラーが発生しないため、修正方法がわかりません。オブジェクトは単に null です。

4

1 に答える 1

0

ScriptContext does not see your C# references - you have to add configuration into your app.config with references to your PHP DLL.

<phpNet><classLibrary><add assembly="xxx.dll" />

Anyway, if you are compiling PHP code in pure mode, you don't have to use ScriptContext at all (thats the point of pure mode); just reference the DLL and use PHP classes in the same way as any other .NET class (no ScriptContext).

于 2014-01-25T01:47:42.900 に答える