Developer forum

Forum » Development » DW10 Scheduled Task add-in cannot load Renci.SshNet (SSH.NET) dependency

DW10 Scheduled Task add-in cannot load Renci.SshNet (SSH.NET) dependency

Wilfred Polderman
Reply

Hello Dynamicweb Support,

I’m building a custom Scheduled Task add-in in Dynamicweb 10 to sync image assets from a customer NAS/SFTP server into DW10 (/Files/Images/…).

The task fails at runtime with this SSH.NET dependency load error:
“Could not load file or assembly ‘Renci.SshNet, Version=2025.1.0.1, Culture=neutral, PublicKeyToken=1cee9f8bde3db106’. The system cannot find the file specified.”

I added SSH.NET via NuGet (SSH.NET v2025.1.0) and uploaded Renci.SshNet.dll together with my add-in DLL. Both are visible under Assets → System → AddIns → Local and Installed, but the Scheduled Task still cannot resolve the assembly.

Could you advise how external dependencies like Renci.SshNet.dll should be deployed/loaded for DW10 Scheduled Task add-ins?

Kind regards,
Wilfred Polderman

SupportImage.png

Replies

 
Anders Ebdrup
Reply

Dear Wilfred,

 

Have you added the line marked with bold in your project file?

  <PropertyGroup>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
  </PropertyGroup>

Best regards, Anders

 
Wilfred Polderman
Reply

Dear Anders,

Thank you for your reply.

I tried your suggestion by adding <GeneratePackageOnBuild> and rebuilding the project. This now produces a .nupkg file, but I’m new to working with Dynamicweb and I’m not sure how (or where) this package is supposed to be used within DW10.

Could you please clarify what the next step is and how the .nupkg should be deployed/installed in Dynamicweb?

Kind regards,

Wilfred Polderman

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Wilfred.

If you install your extension with the CLI, it will place it self in the right location: https://doc.dynamicweb.dev/documentation/extending/index.html?tabs=vscode%2Cupgrading-vscode#cli
Uploading the package or dll is not the same as installing it. So be sure to use the CLI or install inside Dynamicweb in the app store.

Your custom code has dependencies - so install using --queue when installing it as dll: https://doc.dynamicweb.dev/documentation/fundamentals/code/CLI.html#installing-custom-add-ins-and-extensions

I think the original issue you had with the Renci.SshNet.dll not loading is that the Renci.SshNet package also has dependencies (which again have dependencies). When you install as dll's you have to upload/install all dependencies from the dependency graph in the folder - see the dependencies of your dependency here:  https://www.nuget.org/packages/ssh.net/

If you install a nuget package (nupkg instead of dll as Anders suggests) your package will contain the information on the dependency graph and Dynamicweb can install the dependencies for you when you install it.

BR Nicolai

Votes for this answer: 1
 
Wilfred Polderman
Reply

Hi Nicolai,

Thank you for the clear explanation! It works now.

Kind regards,

Wilfred Polderman - Ewings  

 

You must be logged in to post in the forum