Is it possible to host a *CONSOLE* application in AWS - c#

I'm trying to upload a .net console application, which has selenium in it which does some automation in the web.
I have seen the docs that tell us how to upload a mvc application and i have hosted it successfully.
So the question is, is it possible to upload a console application created in visual studio to aws.

Amazon EC2 creates a virtual machine that runs the operating system of your choice.
You can run whatever you wish on it, as long as it does not violate the Terms & Conditions of usage.

you can deploy it to AWS Lightsail or AWS EC2 . But you are in developing some application, it is better to deploy to AWS Lightsail as to reduce cost of development.

Of course Possible it will be very easy, I hope. In my case I use .NetCore 3.1 console app, where I implement tcplistener, tcpClient.
Configure port in aws.
when u create instances u will see public ipv4 address, that u will put in yours
client or app file.
and after than in that instance open cmd -> type ipconfig -> thane u find private
ipv4 address, that use in server file.
Finished!!!

Literally you don't need AWS to host your console app at all, as you can write even simpler AWS Lambda in C#, which is similar to Azure Functions.

Related

Run desktop app via WEB app

I have desktop application that can be installed on the users computer with "setup" msi file like any other application.
I'm developing web application and I need somehow to integrate the desktop application with the web application. Web application is developed using PHP (desktop application is developed using C#), and when clicking on one button on the web application, the desktop application needs to be launched.
Is there a way of doing this? I was thinking about a few scenarios:
-Maybe if possible to install the app directly on the server and to launch it from there?
-Maybe to be required the user to have the app installed on his computer and to call the app from there?
If possible I would prefer to not use the second approach because it's better if the third party to not be involved - it will be more user friendly if the application is launched directly. But any help will be appreciated because at this point I'm not sure if that is possible to be done at all.
You can install app at server an run it with exec() or "`" operator - but to control gui of app you need to use some like autoit ant etc.
If you ultimately decide to require your users to have the client application installed and expect majority of the users to be on Windows, you could register your application to handle specific scheme and parse its command line when started. More on this here:
http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
You'd register a custom scheme and then intercept in in the application's command line arguments. The whole URL will be passed as an argument, e.g.:
myapp://parameter1,parameter2
The browser will mostly ask whether or not the user trusts the application to handle this scheme with an option to remember this setting.
If you don't have access to the source code of the client application, you can develop a middleware, some sort of a launcher that handles the URL and then runs the client application after maybe modifying some configuration files based on the URL or otherwise controlling the third-party application to do as you with.
As for solution #1, I don't think C# matters if your application can run on Mono, so you should be able to just run it from PHP. However, this probably won't work on web hosting and you will have to get a VPS for that.
There are very good (security) reasons why it is hard to launch client-side processes from web browsers.
Do you have access to the source code of the C# app? If so, you could consider modifying it to take advantage of Microsoft ClickOnce deployment.
Some references:
http://msdn.microsoft.com/en-us/library/t71a733d.aspx
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/6ae39a7c.aspx
http://www.codemag.com/Article/0902031
Here's an old article on deploying WinForms applications via ClickOnce with Visual Studio 2005: http://msdn.microsoft.com/en-us/library/ms953320.aspx
It can possibly be done with IIS but it can be cumbersome setting it up to run as the current user, especially since it would probably also need to run elevated for an app that needs to attach to the current user's desktop.
Easiest is to install a Windows LAMP distro (like WAMP: http://www.wampserver.com/en/) and then run the httpd.exe directly from an elevated (Admin) command prompt; do not run apache as a service!
Once you do this performing and exec("command"); call in php will bring up a desktop app as if it was invoked from an admin command prompt. Obviously you need to set up the apache server to be accessible from outside the local system, etc.

Hosting MongoDB on Windows Azure for C# Access

I have read this page: http://www.mongodb.org/display/DOCS/Azure+Deployment, but it seems to be talking about actually setting up an Azure application, which I'm not interested in. I just want to host a Mongo DB on Azure which I can access from some non-Azure application using a connection string. I also tried running the script on this page: http://www.mongodb.org/display/DOCS/MongoDB+Installer+for+Windows+Azure but it threw an exception when it tried to validate the image name. Is what I want possible?
The reason for all of this is that I'm trying to compare MongoDB and Azure Table Storage, and I want to make the scenarios as similar as possible when I performance test.
The first link in your question talks about deploying MongoDB in Windows Azure (also accessible by other applications), but this in a traditional PaaS context. This means you'll be deploying MongoDB in a hosted service/cloud service.
If you want to host MongoDB on Windows Azure in a way that "feels more natural" you should consider deploying it in a Virtual Machine (the second link in your question). There's actually a how to on the Windows Azure website that will guide you through the whole process of creating a VM and deploying MongoDB on that VM: Install MongoDB on a virtual machine running Windows Server 2008 R2 in Windows Azure
Both ways to deploy MongoDB will allow you to access it from non-Azure applications, you'll simply need to configure the endpoints correctly (allowing access to specific ports from outside the datacenter).
Note that Virtual Machines (IaaS) is still a preview feature and the performance in the preview might not reflect the performance of the final version.
You can run MongoDB on Windows Azure two ways. First way is to run as Cloud Service which is described here however this is not what you want.
The second option to run MongoDB on Windows Azure to use Windows Azure Virtual Machine (either Linux or Windows) and then install MongoDB on it. The link below explains how you can install MongoDB on a CentOS machine in Windows Azure:
https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm/
If you decide to use Windows Virtual Machine, you sure can use any MongoDB tutorial to install it on Windows box after configuring Windows Virtual Machine or just use this one.
As you have already tried using Powershell to deploy MongoDB from your desktop to Windows VM, but failed to get working, please write another question with error details and i sure can help.
Finally based on your actual objective I would suggest creating MongoDB on CentOS by following above tutorial and get your test done, which could be easiest MongoDB setup among all the methods we have talked.

Can you publish to an existing Amazon EC2 instance using AWS Toolkit for Visual Studio?

I'm trying out the free tier on Amazon EC2 and intend to host a couple of small websites through the same micro instance. I have set up and configured an EC2 micro instance running Windows Server 2008, with all the necessities. The websites are all ASP.NET MVC3 applications.
I have installed the AWS Toolkit for Visual Studio and connected to my Amazon account, which all works well. The problem I have is that if I right-click my project in the Solution Explorer and choose Publish to AWS..., the only options I have is to publish it to a new instance. This does not work for me, as I want to host multiple sites on the same server.
Is it possible to publish to an existing instance using AWS Toolkit, and if so, how do I go about doing it?
As far as I understand it the quick answer is no. This is because the recommended process after launching a new instance is to change the local admin password from that set by AWS. Since the publish to cloud formation only has the AccessKey & Secret Access Key it cannot get the new admin password & as a result cannot connect to an existing instance.
The quick way around this would be to set the instance's security group to allow FTP from your public IP address and then just publish via FTP.
I actually use a plugin called "dispatch", which publishes directly from Visual Studio to the server via FTP. I hate FTP, but that's the nicest solution I've seen so far.
I've been looking for an alternative myself.
The only other option I've used is called AllwaysSync, which is extremely cool. It can sync up a local hard drive with an S3 account. You can then link that s3 directory to CloudFront.
I've been "considering" doing a double sync with that, where I have alwayssync installed on my development box, and installed on my EC2 server. The EC2 machine has AlwaysSync set on auto-sync, so any changes to the S3 directory would get sucked in to the EC2 machine. That directory would be synced up with my local development machine when I initiate the upload.
Still.... It seems so half-as_ed that I've just sat back and waited for Amazon. They usually come up with something.
One thing that I've found works EXCEPTIONALLY well (if you have a fast connection)
I actually use an EC2 server as a workstation and RDP as a thin-client. There's an app called "SplitView" that lets me use 3 monitors at my worstation. I click a shortcut to RDP, my 3 monitors flicker and boom, All my stuff is still there from last-night. If someone steals my laptop.... there's nothing on it at all, except a link to the RDP account.
Anyway, now (for the Amazon sites) I just drag my files over to the live machine and change the IIS settings to targeet the new directory.

How do I make a program "discoverable" on the network?

Hey guys, I was working on a simple chat program to brush up on my C#, and ran into a roadblock. I wanted to allow one computer to broadcast its location, and the other to find that computer, and display it (and any others) in a list.. Just a push in the right direction would be great,
Thanks,
Max
Mono.Zeroconf is a .NET library that provides common zeroconf opertations - service publish and discovery. It uses Apple's Bonjour for Windows as a transport on Windows.
Developers can publish services that will be exposed to other computers on the local network and also query the local machines on the network for services that could have been exposed.
See Peer-to-Peer Programming with WCF and .NET Framework 3.5.
All you need is to share destination PC. and then run your web-based application on the target pc IIS.
Updated Part :
If you have awindows application and want users use that application youhave some solution
create a Login form for your application
use from MarshalByRef object and create a Channel between user andaplication
create a MSI (setup) and run it from server (in entire Active Directory).this will install one application in each client
create a simple dot net setup. justRight click onyour windowsproject in VS and then select Publich, in the wizard walk through creating a network application
I think the last option is closest one to your request
Use AD (Active Directory)? Or some such [which would serve as] central messageboard mechanism - maybe even MSMQ?

reading remote PC disk capacities via .NET framework

I'm planning on writing a small program that uses the .NET framework to read disk capacities on remote Windows PCs.
I normally write in C#, so I'd like to stick with this. A number of us in our department need access to this program.
Should I write this as:
a desktop app
an MMC snap-in
an ASP.NET application with a service?
Any suggestions? Many thanks.
A different idea, what about a PowerShell cmdlet with WMI?
A service with WCF comes into my mind. Thus, a central application could query the service on each remote windows PC to get the information.
If these PC's already publish their disc capacities in some form (eg. via windows shares or something else), you could omit the service part and directly query the machines.
WMI already publishes this information. So all you need is a client. Depending on the needs of your users, it could be a WinForms app, an MMC SnapIn, a console app, etc etc.

Categories