how to connect SFTP server to visual studio 2022

2025-05-13T18:31:33.1166667+00:00

hello, i have a C# asp net webform project in visual studio 2022. when i will publish it to a webhotel, they have only SFTP server, while visual studio supports FTP server.

how to connect SFTP server to visual studio? i have tried to add SFTP server via manage Nuget manager, i get following error:

Error Could not install package 'SFTPServer 1.3.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

how should i solve the problem? i appreciate your step by step solution. very kind regards

Windows för företag | Windows-klient för IT-proffs | Användarupplevelse | Övrigt
0 kommentarer Inga kommentarer

3 svar

Sortera efter: Mest användbara
  1. Andrew K 0 Ryktespoäng
    2026-05-28T20:14:57.12+00:00

    FTPSheep Visual Studio extension can publish your ASP.NET website to the server via SFTP: https://marketplace.visualstudio.com/items?itemName=FTPSheepNET.ftpsheep-net

    Var det här svaret till hjälp?

    3 personer tyckte att det här svaret var användbart.
    0 kommentarer Inga kommentarer

  2. venus-messiah manzar-nejad 0 Ryktespoäng
    2025-05-23T10:17:12.1466667+00:00

    hello. i have published my C# asp.net webforms project by folder in visual studio 22. i have uploaded all files in file manager's webhotel, through FileZilla. but when i press a button in my page, it appears root of the page, not a designed page. 

    check your-event.se and choose any button, you se what i mean. i appreciate your support. very kind regards

    Var det här svaret till hjälp?

    0 kommentarer Inga kommentarer

  3. Smith Pham 2,795 Ryktespoäng Oberoende rådgivare
    2025-05-15T02:15:55.8566667+00:00

    Dear Team

    This is my answer. Please help me to take a look to see if there is any issue.

    Step 1: Publish Locally

    In Visual Studio 2022, right-click your project → Publish.

    Create a new Publish Profile.

    Choose "Folder" as the publish target (instead of FTP).

    Set a local folder, e.g.:

    makefile
    Copy
    C:\PublishedWebApp\
    

    Click Publish. Visual Studio will build and output all necessary files to that local folder.


    🔹 Step 2: Upload Files to the SFTP Server

    Since Visual Studio doesn’t support SFTP directly, use one of these options:

    ✅ Option A: Use a Free SFTP Client (Manual Upload)

    Use WinSCP or FileZilla:

    Download WinSCP: https://winscp.net/

    Enter your SFTP credentials from your webhost:

    Host: yourserver.com

      Protocol: `SFTP`
      
         Port: usually `22`
         
            Username and password
            
            Connect and navigate to the correct web root (e.g., `public_html`)
            
    
    • Upload the contents of C:\PublishedWebApp\ to the SFTP folder 🔹 Step 1: Publish Locally
      1. In Visual Studio 2022, right-click your project → Publish.
      2. Create a new Publish Profile.
      3. Choose "Folder" as the publish target (instead of FTP).
      4. Set a local folder, e.g.:
             makefile
             Copy
             C:\PublishedWebApp\
        
      5. Click Publish. Visual Studio will build and output all necessary files to that local folder.
      🔹 Step 2: Upload Files to the SFTP Server Since Visual Studio doesn’t support SFTP directly, use one of these options: ✅ Option A: Use a Free SFTP Client (Manual Upload) Use WinSCP or FileZilla:
      • Download WinSCP: https://winscp.net/
      • Enter your SFTP credentials from your webhost:
        • Host: yourserver.com
        • Protocol: SFTP
        • Port: usually 22
        • Username and password
      • Connect and navigate to the correct web root (e.g., public_html)
      • Upload the contents of C:\PublishedWebApp\ to the SFTP folder

    Var det här svaret till hjälp?

    0 kommentarer Inga kommentarer

Ditt svar

Svar kan markeras som godkända svar av personen som ställde frågan, och som rekommenderade svar av moderatorerna, vilket hjälper användarna att veta om svaret löste problemet.