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:
- Install .NET Core SDK for both Windows and Mac.
- Create a new console application or Windows service project (for Windows) and a launchd service (for Mac) in Visual Studio or VS Code.
- Install the SSH.NET library using NuGet.
- 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. - Add a login screen to your application to allow users to enter their credentials to access the SFTP server.
- 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.