How to run visual studio console application from windows on linux server machine?

NALB 71 Reputation points
2023-05-02T08:14:41.4066667+00:00

Hello ,

I have question regarding visual studio , I have a console application that uses some data from Linux server ,

how can I run my application remotely from my windows on Linux without having to add the application on the Linux server .. for the sake of debugging I added my application on the server to try it and it worked but how to do that remotely ?

or do I need to leave the console app on Linux and add apache server on Linux machine and fire the app from windows and add the needed output data in some sort of storage then retrieve it on windows ?

Thank in advance

Developer technologies Visual Studio Debugging
Developer technologies C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,436 Reputation points Microsoft External Staff
    2023-05-02T12:19:07.2366667+00:00

    Hello @NALB ,

    Welcome to Microsoft Q&A forum.

    Not sure if running/debugging the project in Linux without leaving VS by using WSL meets your requirement or attaching to the processes running on the remote Linux deployment over Secure Shell (SSH) meets your requirements. Please kindly check following two documents: Debug .NET Apps in WSL with Visual Studio, Debug .NET Core on Linux using SSH by attaching to a process.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-05-02T16:21:58.06+00:00

    for the app to run on the linux server, it must be installed/copied to the linux server. as suggested above, you can use an ssh (remote shell) app on windows to to run a remote shell on linux. in this shell windows you can run the app. linux also supports debugging via ssh, so visual studio can run and debug an .net app on linux.

    with ssh you can use the scp to copy, or if you use PuTTY then pscp to do the remote copy.

    apache is a web server, and not sure what you are suggesting. apache can run a cgi (console) app, but the app would be expected to return html.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.