lordfritte
Lieutenant
- Registriert
- Juli 2006
- Beiträge
- 956
Hallo ich versuche gerade in einem php script eine c# dll zum laufen zu bekommen, aber es will nicht so ganz klappen.
im htdocs auf einem xampp Apache Server habe ich 2 Dateien:
1. phpTest.php:
2. PhpTestDll.dll:
Aber wenn ich das Sctipt ausführe bekomme ich nur das:
Muss ich die Dll in ein bestimmtes Verzeichnis kopieren?
im htdocs auf einem xampp Apache Server habe ich 2 Dateien:
1. phpTest.php:
PHP:
<?php
$test = new DOTNET("PhpTestDll.dll", "PhpTest.phpTestClass");
echo $test->SayHallo();
?>
2. PhpTestDll.dll:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PhpTest
{
public class phpTestClass
{
public string SayHallo()
{
return "Hallo Welt!";
}
public double Add(double d1, double d2)
{
return d1 + d2;
}
}
}
Aber wenn ich das Sctipt ausführe bekomme ich nur das:
Code:
Fatal error: Uncaught exception 'com_exception' with message 'Failed to instantiate .Net object [CreateInstance] [0x80070002]
Das System kann die angegebene Datei nicht finden. '
in D:\xampp\htdocs\phptest.php:2 Stack trace:
#0 D:\xampp\htdocs\phptest.php(2): dotnet->dotnet('PhpTestDll.dll', 'PhpTest.phpTest...')
#1 {main} thrown in D:\xampp\htdocs\phptest.php on line 2
Muss ich die Dll in ein bestimmtes Verzeichnis kopieren?