Trying to use as a reference error

Topics: Customizing Orchard, General, Writing modules
Jun 26, 2015 at 3:21 PM

I'm trying to SSH into Linux servers and I found the package It works in standalone projects I've made ,but when i try to add it as a reference and run it on orchard it gives me an error saying it cant load it. (See error below)

An exception of type 'Orchard.OrchardCoreException' occurred in Orchard.Framework.dll but was not handled in user code

Additional information: Error compiling module "Modules.SSH.Module" from file "/OrchardLocal/Modules/Modules.SSH.Module/Modules.SSH.Module.csproj":

Assembly reference 'Renci.SshNet, Version=2013.4.7.0, Culture=neutral, processorArchitecture=MSIL' for project '/OrchardLocal/Modules/Modules.SSH.Module/Modules.SSH.Module.csproj' cannot be loaded

I've added it using nuget and I'm not understanding why it refuses to run and load the referenced package.
Jul 1, 2015 at 7:48 AM
Edited Jul 1, 2015 at 8:17 AM
Are you experiencing your problem with a local Orchard installation or with an Azure deployment?

When you deploy to Azure (using the Orchard.Azure.slc solution), all the DLLs you are using need to be present either in the sitesroot\0\bin\ directory of your Azure package (which should be identical to Orchard.Azure.Web\bin), or in the GAC of the targeted machine (framework assemblies).

What I don't know are the rules that dictate whether or not a DLL will be copied to this folder if it is not directly referenced by the Orchard.Azure.Web project (because sometimes, this is the case...) - but when it is not copied, you need to add a reference to the assembly (or add the NuGet package) into the Orchard.Azure.Web project.

WIth a local installation the rules are a bit different because Orchard is able to load assemblies from their module's bin folder, but maybe this is not always the case (depending on the assembly) - not sure of that. You could then try to add the NuGet package to the Orchard.Web project in addition to your module and see if this solves your problem.