开发者

Integrating a C# app with an existing website

I have some backend functionality which need to be written in C# (for political, not technical reasons).

The C# 'module' is to provide functionality for a website, which is written in PHP.

The hosting environment for the completed solution will be as follows:

  1. Operating system: Linux
  2. Web server: Apache
  3. Backend db: mySQl and/or PostgreSQL.

The C# 'module' will be business logic only, (i.e. no GUI).

This is my proposed solution so far, I would like to know if I am going down the correct path and/or if my proposed solution may be improved:

  1. I am guessing that I will have to write and deploy the C# module as a stand alone executable

  2. Add a RESTful API to the C# executable or communicate directly to the C# executable using TCP/IP from the web app. I prefer the RESTful API since it is higher level, but there may be performance considerations - I'd like to hear of pros and cons on choosing one over the other - to help me to decide whether to use a RESTful API or TCP/IP to communicate with the web app.

  3. What is the "best" way to bind C++ to C# (I will be making use of C++ libraries in my C# application).

开发者_如何学CI will have mono installed on the server, to host the C# application.

Since I don't often use C#, I wonder if a "C# expert" can tell me if I am going about this the right way, and/or if this approach can be improved?


  1. Yes. My guess is you would want it to be an executable communicating with WCF or a Web Service hosted with IIS communicating with WCF.

  2. Depending on your requirements, I would investigate the HTTP Long Polling technique.

  3. C# can use PInvoke through DllImport to use any available C++ library calls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜