Is it possible to deploy a console c# application on IIS Server. I have one .exe file running on a machine which takes data from named pipe and my c# application takes this data from the pipe and send it to the web application running using TCP sockets, I want to know if i can deploy my C# console application on the webserver? I am new to ASP.net and C#.
2 Answers
You can host an exe file on IIS server, but it is not a common practice to deploy C# console applications,
- In this way you don't know if the client machine has proper .NET Framework installed. So the console application may not even launch.
- The web browser can simply block the download.
- Even if the exe file is downloaded, unless the user launches it locally, it won't run automatically.
Recommended approach by Microsoft is to deploy the client side application using ClickOnce,
http://msdn.microsoft.com/en-us/library/t71a733d%28v=vs.80%29.aspx
You can then host the ClickOnce installer on IIS side. For example, Microsoft CodePlex uses this kind of deployment for its open source projects,
4 Comments
Arpit Bajpai
Thanks for responding. i will explain my scenario. 1. I have an exe taking real time data from an external device and putting it in a named pipe (exe is running on the server machine) 2. I should have a script running on the server to take this data from named pipe and send it to the client side using TCP Socket ( as of now i have a c# console application to do this) 3. A client side ASP code, that takes the data from tcp socket and shows it on the web page on real time basis. My doubt is that how to run that C# code(point 2) on webserver?
Lex Li
Since it does not require any user involvement, you can safely make point 2 a Windows service application instead of a normal console application. In this way, this service always run in the background (communicating via named pipe/TCP), and ASP.NET web site can consume its data via TCP as you desired. Then ClickOnce is no longer needed.
Arpit Bajpai
ok My question might be stupid? but i have never used windows service application... this windows service application(it will be in c#) will run on Web Server?
Lex Li
You can create a Windows service application inside VS, and it can be installed on the web server, msdn.microsoft.com/en-us/library/zt39148a%28v=vs.80%29.aspx