0

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

Serguei Fedorov
  • 7,763
  • 9
  • 63
  • 94
  • Can you compile it? Or do you only have problem with intellisense (code auto-complete)? – Tarik Jul 27 '12 at 00:58
  • And also perhaps this article can help you if you are missing something: http://dotnet.dzone.com/articles/php-scripting-language-c – Tarik Jul 27 '12 at 00:59
  • It seems like I can put "use thisisjargon" and it will just ignore it. I can't compile it if I try to call something that is inside the library, just doesn't see it. – Serguei Fedorov Jul 27 '12 at 00:59
  • Have you checked out the article I put in my last comment? – Tarik Jul 27 '12 at 01:00
  • Hmmm, doesn't seem to have anything that would help solve this issue. I have access to most of the System\.. stuff, but for my library it seems to refuse... – Serguei Fedorov Jul 27 '12 at 01:02
  • Could it be that the library is not COM visible? – Serguei Fedorov Jul 27 '12 at 01:12
  • 1
    Maybe, why don't you check this article: http://jumbloid.blogspot.com/2009/12/making-net-dll-com-visible.html – Tarik Jul 27 '12 at 01:13
  • Haha, thats exactly the article im looking at :) – Serguei Fedorov Jul 27 '12 at 01:14
  • Hmmm, looks like in Phalanger 3.0 they changed how the import namespace stuff works and now its refusing to work, even when I change it to "use". That I mean with the example from here: http://www.codeproject.com/Articles/17311/Phalanger-PHP-for-NET-Introduction-for-NET-develop#4 – Serguei Fedorov Jul 27 '12 at 02:04
  • Ok, its actually working now :). However, any idea why it might not be showing up in Visual Studio intellisens like the .Net stuff? – Serguei Fedorov Jul 27 '12 at 02:34

1 Answers1

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

Jakub Míšek
  • 1,036
  • 9
  • 12
  • Thanks a lot for the response Jakub! I currently have the June 2012 version (http://phalanger.codeplex.com/) and I am having this problem. This does not seem to happen with the .NET libraries. Ill post the issue on the forums! – Serguei Fedorov Jul 27 '12 at 18:30