compile dll
8 posts
• Page 1 of 1
compile dll
I am writing a c# managed dll for using it into an mvc web app.
I need to integrate some 3rd party php code in this dll:
1- can i compile a dll with mixed language code php + c#?
2- can i compile the 3rd party php code in a dll and reference in my own c# dll? (i just see web project and console app)
3- maybe i will just get or post to a php PAGE from my mvc app: can i add php page to a mvc app solution or should i have 2 separate projects?
what other options i have to interoperate from c# mvc app code ?
thank you in advance
I need to integrate some 3rd party php code in this dll:
1- can i compile a dll with mixed language code php + c#?
2- can i compile the 3rd party php code in a dll and reference in my own c# dll? (i just see web project and console app)
3- maybe i will just get or post to a php PAGE from my mvc app: can i add php page to a mvc app solution or should i have 2 separate projects?
what other options i have to interoperate from c# mvc app code ?
thank you in advance
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
In order to do what i wrote above, I installed Phalanger.
After installing i get this error at visual studio startup
after VS starts , php projects appear as 'the application is not installed'
---------------------------
Microsoft Visual Studio
---------------------------
The 'PHP Tools for Visual Studio Package' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\ME\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve this issue.
Continue to show this error message?
---------------------------
Sì No
---------------------------
After installing i get this error at visual studio startup
after VS starts , php projects appear as 'the application is not installed'
---------------------------
Microsoft Visual Studio
---------------------------
The 'PHP Tools for Visual Studio Package' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\ME\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve this issue.
Continue to show this error message?
---------------------------
Sì No
---------------------------
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
update:
after the previous message we have the following:
---------------------------
Microsoft Visual Studio
---------------------------
The 'PhpTestPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\ME\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve this issue.
Continue to show this error message?
---------------------------
Sì No
---------------------------
after the previous message we have the following:
---------------------------
Microsoft Visual Studio
---------------------------
The 'PhpTestPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\ME\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'.
Restarting Visual Studio could help resolve this issue.
Continue to show this error message?
---------------------------
Sì No
---------------------------
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
update:
i solved and restored phptools working, just reinstalling it.
I do not see Phalanger working in Vs
second update:
i found out that I needed to uninstall phptools before installing phalanger.
this way i solved the errors.
i solved and restored phptools working, just reinstalling it.
I do not see Phalanger working in Vs
second update:
i found out that I needed to uninstall phptools before installing phalanger.
this way i solved the errors.
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
danceoften wrote:I am writing a c# managed dll for using it into an mvc web app.
I need to integrate some 3rd party php code in this dll:
1- can i compile a dll with mixed language code php + c#?
2- can i compile the 3rd party php code in a dll and reference in my own c# dll? (i just see web project and console app)
3- maybe i will just get or post to a php PAGE from my mvc app: can i add php page to a mvc app solution or should i have 2 separate projects?
what other options i have to interoperate from c# mvc app code ?
thank you in advance
i found out that it's possible to use phalanger for this task and succeded installing it by first removing phptools.
i decided to move the original answer above in phalanger forum
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
Phalanger is a PHP language compiler, it produces DLL file from PHP files.
1. no, like you can't mix C# and VB.NET, you can however reference DLL from a C# project.
2. yes
3. you can, by using PHP.Core.RequestHandler into web.config, all the .php files are compiled on web server lazily and you can make requests to them. However you can do the same with legacy php.exe.
I would recommend to compile .php files into a DLL (either by creating a separate project in VS or in a prebuild action of your ASP.NET website `phpc.exe /target:dll /out:website.dll /recurse:.`, reference this DLL and make use of Php.Core.Context API where you can simulate PHP runtime.
1. no, like you can't mix C# and VB.NET, you can however reference DLL from a C# project.
2. yes
3. you can, by using PHP.Core.RequestHandler into web.config, all the .php files are compiled on web server lazily and you can make requests to them. However you can do the same with legacy php.exe.
I would recommend to compile .php files into a DLL (either by creating a separate project in VS or in a prebuild action of your ASP.NET website `phpc.exe /target:dll /out:website.dll /recurse:.`, reference this DLL and make use of Php.Core.Context API where you can simulate PHP runtime.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
Re: compile dll
Jakub Misek wrote:Phalanger is a PHP language compiler, it produces DLL file from PHP files.
1. no, like you can't mix C# and VB.NET, you can however reference DLL from a C# project.
2. yes
3. you can, by using PHP.Core.RequestHandler into web.config, all the .php files are compiled on web server lazily and you can make requests to them. However you can do the same with legacy php.exe.
I would recommend to compile .php files into a DLL (either by creating a separate project in VS or in a prebuild action of your ASP.NET website `phpc.exe /target:dll /out:website.dll /recurse:.`, reference this DLL and make use of Php.Core.Context API where you can simulate PHP runtime.
Thank you for your support, I decided i will go with solution 2:
I will compile third party php code in a managed dll and then reference it from my code (c# dll).
for doing this i found some instruction in an article :
http://tomasp.net/blog/aspnettexy.aspx/
where is suggested to just remove includes and to statically call defines in constructor.
so i modified the php code accordingly.
My question now is, wich template should i choose for having a managed dll ?
in the article it mention a pure mode but i cannot find this setting in the project properties when choosing the phalanger/class library.
Thank you again for the phalanger implementation of php under .net
- danceoften
- Posts: 14
- Joined: May 29th, 2014, 2:36 pm
Re: compile dll
Good.
Phalanger/Class Library is a Pure mode project.
Phalanger/Class Library is a Pure mode project.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests