I want to make and Desktop Application for windows and mac

Deepak Kumar 20 Reputation points

Hello team,

I want to make an desktop application for both windows and mac. Also this would be a background app basically which once users logins into acc, the app will keep running as a background process and keep syncing a local folder to a SFTP server. For reference, I want to tell that I want to make something like Box Sync Application which Box uses to sync ones local files to their Box acc.

Please suggest how can this be done in DotNet.

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,208 questions
{count} votes

Accepted answer
  1. Alan Farias 745 Reputation points

    To develop a desktop application that can run on both Windows and Mac, you can use the .NET Core framework. .NET Core is a cross-platform, open-source framework that supports building applications that can run on different operating systems.

    For your requirements, you can create a console application or a Windows service (for Windows) and a launchd service (for Mac) to run in the background. You can use the SSH.NET library for .NET Core to connect to the SFTP server and synchronize the local folder.

    Here are some general steps you can follow to create the application:

    1. Install .NET Core SDK for both Windows and Mac.
    2. Create a new console application or Windows service project (for Windows) and a launchd service (for Mac) in Visual Studio or VS Code.
    3. Install the SSH.NET library using NuGet.
    4. Implement the logic to connect to the SFTP server and synchronize the local folder. You can use the SftpClient class from SSH.NET to establish an SFTP connection and perform operations like uploading, downloading, and deleting files.
    5. Add a login screen to your application to allow users to enter their credentials to access the SFTP server.
    6. Deploy the application to both Windows and Mac platforms.

    Note that there may be some platform-specific differences that you need to consider when developing the application. For example, the file system paths on Windows and Mac are different, so you may need to use platform-specific APIs to get the correct path.

    Also, for running the application in the background, you will need to use platform-specific APIs like Windows Services or launchd services on Mac. You can find more information on how to create a background service for your application in the official .NET Core documentation.

    Overall, creating a cross-platform desktop application using .NET Core is a feasible solution for your requirements.

    Please, if this answer is helpful, click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please let me know.

0 additional answers

Sort by: Most helpful