Connect Unix/Solaris with .NET using SSH - c#

For my project I need to connect with remote Unix server from my local machine. I want to connect the machine using Visual Studio in the same manner as we can connect Java using SSHXCute JAR and be able to execute Unix command, upload file etc.
Please suggest a way to do the task in dot net c#

A Secure Shell (SSH) library for .NET

Related

Deploying C# SQL Server SMO application

Forgive me if this is not the correct forum for this ask but I have a c# application that uses SMO to setup a database on a remote server. I am wondering how to deploy this application as it works fine on my dev server but when I deploy it is missing batchparser and batchparser.client.dll files. They exist in the bin folder and I have referenced them by installing the Microsoft.SqlServer.SMO nuget package.
According to the official documentation:
Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.
This is a replacement for SharedManagementObjects.msi, which was previously released as part of the SQL Feature Pack for each release of SQL Server. Applications that use SMO should be updated to use the NuGet package instead and will be responsible for ensuring the binaries are installed with the application being developed.
I would assume this to mean I should be able to install the nuget package and all should be referenced correctly. Am I missing something big here? Does SQL Server need to be installed on the machine I am running my C# application from?
My architecture is as follows:
Web server
SQL Server
Web admin logs into (1) web server and runs my c# program which sets up some IIS based .net websites on that machine, then from the web server it will REMOTELY setup a database by running the smo commands. The C# program will execute the commands on the web server and remotely configure a SQL Server (2)(another machine).
Can this be achieved using C# and SMO without having an instance of SQL/SQL tools on the web server?
Thanks

Deploy and start .NET service on multiple Windows Server 2012

I have a service written in C# that relies on features in .NET 4.5 that are not yet supported in any version of mono, so I have to use Windows servers. In other cases to deploy a network service I would just SCP a jar/tar/whatever over and then SSH over the deployment process, and that can be made a part of an sh script that can distribute to wherever. But because this is Windows, I don't have those tools and I'm at a bit of a loss as to how to deploy this to 20 (or more) different servers.
So I see that there is a publish process in MSVS 2012, but it seems to make use of Windows file shares or else I'm supposed to send it to a website of some kind(???) but it doesn't look like it has any way of starting it even if I could figure out how to get it there.
Is there some product that does this in Windows or would it be easier for me to just install an SSH server? I have remote desktop access, but would prefer not to have to deploy anything manually on them.
Thank you!
Try using Powershell with WMI. [This question] (https://superuser.com/questions/337810/how-can-i-remotely-install-or-uninstall-a-service-on-windows-server-2008-r2) discussed some approaches to install windows service remotely.

C# Winforms - How to run exe file in other system

How to run exe file of C# Winforms app in other system or my client system?
In that Winforms application I have used SQL Server 2005 & C# for frontend ....
Now can anyone tell me, for that Winforms apps, remote connections is necessary or not? If yes then how to work on that, so I can easily run the exe file on other system also ?
I have done exe part but that file runs only on my system & that not runs on other system .
Just publish your .exe using Click Once and add all the required Prerequites.
About Sql Server you have to install that on your client system and attach your database.
Goto Project Properties
Click on Publish Tab
Press Prerequisites and select all you need for your application to run like .Net Framework...
Click on the Publish Now Button
If you are trying to access an SQL database from another machine you will need to make sure remote connections are enabled, firewall has the right exceptions in it and the connection string points to the servers full computer name/ip address.
EDIT
How to enable remote connections SQL server 2005
SQL server 2005 connection strings
Connect to database using sql server remotely

Execute C# code on Centos (Linux)?

I have simple C# console application developed in Visual Studio 2008, which writes information in MySQL database. Is it possible to run the application in my hosting environment (Cent OS, with local MySQL database)? I have only control panel or ftp access to my hosting space. The database is only accessible from local (from the hosting space).
I have read something about Mono/Monodevelop, but those need to be run on the Cent OS, right? I don't have access to install this or other staffs on the hosting environment.
Given what you've specified about the environment and your limitations, not you can't run it.
You will need to have Mono installed to run a .NET app on Linux. If you can't install it, you're probably out of luck.
You could check with your hosting provider to see if they have other options.
If your hosting provider allows it, has mono installed, and you've verified that your application runs under mono you may be able to invoke the program via a shell command from php.
<?php
$output = shell_exec('mono myprogram.exe');
echo "<pre>$output</pre>";
?>
If your host has mono installed, and you have the ability to execute arbitrary shell commands from PHP, then you can run it. Otherwise no. Do you have the source to the program? If so, I would just port the code to PHP (or whatever your host provides).

How to access Linux directories/files from a Windows Service using C#

I have a C# Windows Service that needs to access to a Linux computer to get a list of files in a particular directory. What .NET 3.5SP1 method would one use that allows me to do this?
Thanks.
You'll have to create a Samba (SMB) or NFS share on the Linux box that is accessible from the Windows machine that is running your application.
You can then use the standard tools for working with files/directories in .NET to work with the files.
As mentioned in comments, you could also use the standard FTP libraries which would require configuring an FTP server on your Linux machine. SFTP is also an option...but would require a third party library on the .NET side.
Hi you can check at my open source project http://code.google.com/p/nekodrive You can use directly NekoDrive.NFS c# library that wraps my implementation of V2 e V3 NFS Protocol (V4.1 is coming).. It doesn't support the full protocol yet but It works for basic browsing/download/upload functions..
hope this helps

Categories