Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2008, 05:33 PM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default calling .NET from C

Hello!

I am trying to develop a proof-of-concept HelloWorld kind of thing that is basically an interpreter of server pages. The challenge is to have the same codebase for the interpreter being called from an Apache module and an IIS handler.

So, calling this "thing" (written in C#) from an IIS 7.0 handler is easy (also C#) but to my knowledge an Apache module can only be written in C, so I'll have to call C# code from C - is this possible?

The idea was to have this interpreter of sorts work in both IIS and Apache, like PHP :D

Any thoughts? Thanks for your time and reply!


 
Old July 17th, 2008, 01:06 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Assuming you are talking windows only, then yes, php can load .Net components:

http://www.php.net/manual/en/book.dotnet.php

/- Sam Judson : Wrox Technical Editor -/
 
Old July 17th, 2008, 04:28 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You mis-understood my question: the thing is to have something PHP-like in terms of working with Apache and IIS, but definitely not PHP.

It's basically a matter of calling .NET from C.

 
Old July 17th, 2008, 04:33 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

I don't know C, so can't really answer your question any further. Are you able to call COM objects, because you could expose your .Net classes as COM objects perhaps?

/- Sam Judson : Wrox Technical Editor -/
 
Old July 17th, 2008, 04:35 AM
Registered User
 
Join Date: Jun 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmm... I don't think COM would be multi-platform. Thanks for your help, in any case

 
Old July 17th, 2008, 04:54 AM
samjudson's Avatar
Friend of Wrox
 
Join Date: Aug 2007
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

If you want cross-platform then you are looking at Mono.

Try looking into something like this: http://www.mono-project.com/Mod_mono

If this doesn't answer you question then I suggest finding a forum devoted to Mono, as you are far more likely to find your answer there.

/- Sam Judson : Wrox Technical Editor -/





Similar Threads
Thread Thread Starter Forum Replies Last Post
.Net do not use all the cpu calling to C++ DLL wakeup .NET Framework 2.0 5 January 23rd, 2008 05:29 AM
Calling one VB.NET script from another kwilliams VB.NET 2 September 11th, 2006 06:26 AM
Calling com component from Asp.net 1.1 Salma Hanif Shaikh ASP.NET 1.0 and 1.1 Basics 0 June 9th, 2006 07:20 AM
Calling a .NET function from javascript jainnid General .NET 6 June 8th, 2005 04:54 AM
Calling a .Dll of Vb.NET enggalok C++ Programming 0 March 1st, 2004 06:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.