Phalanger c# DLL assembly imported but cannot be called

元气小坏坏 提交于 2019-12-08 10:47:05

问题


I am having a problem where I cannot get the c# code to show up or even be usable while using Phalanger. By their definition, all I have to do is add

    <add assembly="Utility">

which happens succesfully because if I change the name slightly, the page crashes, so I know its actually picked up on the library. However when I try

    <?php
        use Utility\...; //new version of phalanger uses "use" not import
     ?>

I get nothing. Not only does it not show up in the intellisense but when I actually try to call a function which belongs to it, it does not show up either.

Any idea on what might help me here? I have namespaced the DLL which seems to be a requirement. Other than that, I am not sure what else I could do... Any help is greatly appreciated!

source:

http://www.codeproject.com/Articles/17311/Phalanger-PHP-for-NET-Introduction-for-NET-develop


回答1:


You are doing it right.

You don't have to make the assembly COM-visible.

All you have to do is to specify the assembly in <classLibrary> configuration section. There are two ways:

<add assembly="Full Assembly Name" /> when the assembly is in GAC

<add url="assembly relative file name" /> when the assembly is in current dir or subdir.

But another question is, whether Phalanger Tools displays what it should. If your program is compilable, but you just don't see the classes/functions in IntelliSense, update Phalanger Tools to never version (version from 27th July 2012 should fix it). If you have an issue with Phalanger Tools, report it at http://support.devsense.com/viewforum.php?f=10



来源:https://stackoverflow.com/questions/11680122/phalanger-c-sharp-dll-assembly-imported-but-cannot-be-called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!