PHP5.5 调用C#写的dll

dll

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

namespace Toledo
{
    [ComVisible(true)]
    public class Scale
    {
        public string write()
        {
            return "hello world!";

        }

    }
}

已经强制签名、已经注册:

regasm  Toledo.dll <回车>

gacutil /I Toledo.dll <回车> 

PHP.ini

[PHP_COM_DOTNET]
extension=php_com_dotnet.dll

index.php

<?php
    $j = new COM("Toledo.Scale") or die("调用COM失败!");
    $s = $j->write();
    echo $s;

报错

Fatal error: in D:\xampp\htdocs\com\index.php on line 2

非常费解,求指点! -_-||

阅读 7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题