Publishing a c# console application on IIS Server - c#

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#.

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,
http://codeplex.codeplex.com/wikipage?title=ClickOnce

No, IIS can be used to host only web sites or web applications. You can't host console applications in IIS.

Related

In Azure Devops, how can I deploy an exe file to as server as part of release (or something similar)

A solution consists of...:
Web app
Console app ("jobserver", which pulls jobs and processes them)
All is C#, .Net Core 5.
I have continuous deployment set up, so new versions of the web app are deployed to Azure Web App automatically.
However, the console app, I cannot figure out a good way to deploy to a Windows server (or pull). Right now, I go to the server, stop the app if it is not doing anything (otherwise I wait a bit). Then I copy the files over and start it up again. All manually.
I can think of several complicated workarounds, but I am thinking there must be easier way.
What are some ways the deployment of exe file could be handled? How are others handling this?
Ps. The console app cannot run on Azure Web App or as WebJob or similar, because it has requirements that means it has to run on a "real" windows server.
You can use the PowerShell on Target machines or SSH tasks to run commands on a remote machine. Similarly, to copy files, you can use Windows Machine File Copy or Copy Files Over SSH to copy your .exe to the server.

Packaging a C# MVC4 Web app as a standalone desktop app

I'm wondering if it's possible to somehow package an ASP MVC4 web application (that would normally run on an IIS server+SQLLite) as a standalone desktop application?
As a result, I could distribute a single executable to be run on a desktop computer that displays the URL to which the user would then navigate using her local browser.
I read about Hostable Web Core but for some reason it seems to be tied to IIS7 which I do not want to. Anything IIS8+ or even simply .NET 4.X based is required.

Socket Server in Amazon Elastic Beanstalk

Currently, I have a socket server, that listens to incoming connections on two ports (e.g. 7777 and 7778) and replies to them. The data is stored in an RDS environment, part of a bigger Elastic Beanstalk environment that accesses the same data. The socket server is implemented as a Windows service. So far, so good. It works.
However, I am asking myself, whether it's possible to have the socket server also within the same (or possibly another) Elastic Beanstalk environment, but so far, I haven't found any way to do that.
My goals are
to have a far simpler deployment procedure, as in the productive environment, I need the socket servers to be behind a load balancer and don't want to deploy a windows service on each instance.
to have only one environment to deploy to, so that I won't have to deploy (manually or automatically) each time I have a change in the DAL.
The socket server does not need to be implemented as a Windows service, it just is now.
Everything is implemented in C#. Any help is appreciated.
I think, I got this covered. However, I couldn't deploy the Windows Service without errors stand-alone, but only as part of a Web application. Not a real problem in my scenario, though.
I have two projects for this scenario; a Web Application and a Windows Service application.
On the build server, I create a ZIP file of the Windows Service
executables (using zip.exe)
On the build server, I upload the ZIP file to an S3 bucket (using s3.exe)
On the project of the web application, I create a .ebextensions directory
In the .ebextensions directory, I have a whatever.config file that
Takes the ZIP file from S3 and unpacks it onto the C-Drive in my preferred directory
Calls a batch file (part of the ZIP file) that uninstalls and reinstalls the Windows Service with the InstallUtil.exe utility (part of the .Net framework)
In my nightly builds (of the complete solution), I deploy the web application to Elastic Beanstalk using awsdeploy.exe.
Therefore, I point to a configuration.txt file in a builds directory of my web application.
You can generate such a build file with a manual Elastic Beanstalk deployment from Visual Studio; but they are quite easy after a while.
What happens now, is that in my Nightly Builds the Web application is deployed to the Elastic Beanstalk environment; the deployment will recognize that there is a configuration and will execute the steps mentioned below step 4 above. As the Nightly Build created and uploaded the ZIP file of the Windows Service before that, I am sure that I will install the most recent Windows Service.
My only problem now is that the Windows Service does not always install itself because of the infamous marked for deletion error. But that's another story.
I hope this helps somebody. If anyone has a suggestion to simplify this, he's welcome to add a comment.

Testing Silverlight Application in other PC without configuring IIS

Newbie here. I have created a Silverlight App which retrieves data via WCF RIA Services. Now I would like test it to another PC so I did a Publish. The folder contains bin, ClientBin (with xap), .html, .config, etc.
I then copied the folder to the other PCe and opened the *.html file
My silverlight app didn't run. Do I really need to configure the IIS for the other machine and deploy the binaries there to see my silverlight application in action?
Thanks!
If you want simply to watch Silverlight UI (without using WCF) you can, of cource, open *.html page with the application. But if your application needs in WCF service, the service should be runned.
If your machines in domain group and you have IIS installed for one of them, you can in Visual Studio in project properties configure use local IIS insted of developers web-server, then you should update service references and then you can browse silverlight app. from within any computer in domain network.

How to deploy asp.net web application multiple times on the same server?

I have a ASP.NET 3.5 web application and I would like to allow users to install this web application multiple times on the same server.
Each web app will work with it's own database:
Server1
--------
WebApp1 - database1
WebApp2 - database2
WebApp3 - database3
Firstly I tried to use web-deployment-project, but it allows me to install my web application only once.
How I should implement deployment of web app multiple times on the same server? Should I develop my own winforms application?
Yes. I think that will be the best way to do it and by writting your custom app you'll be able to meet your specific demands.
You should make a winform application that emulates the process being done by web deployment project (like copying files to the file system, creating new application \ virtual directory on the select website, etc.).
You probably need to do this:
Create a virtual directory in IIS for
each of your databases
Be sure to set the config files for
each web application to the correct
database
When you deploy, copy your files to each directory minus your config files
You could write a small application or batch file to do it.
the best is to use Web Deploy 3.0
Web Deploy (msdeploy) simplifies deployment of Web applications and Web sites to IIS servers. Administrators can use Web Deploy to synchronize IIS servers or to migrate to newer versions of IIS. Web Deploy Tool also enables administrators and delegated users to use IIS Manager to deploy ASP.NET and PHP applications to an IIS server.

Categories