cancel
Showing results for 
Search instead for 
Did you mean: 

SSH.Net compiler error

WilliamHillman
Level 2
Hello all, I am using the SSH.NET VBO and keep running into a compiler error that is preventing me from running the object. My goal is to list items from an SFTP source. The error reads as follows:

Page: Initialise
Stage: Stage1
Type: Error
Action: Validate
Description: Compiler error at top section line -13: Metadata file 'Renci.SshNet.dll' could not be found
Repairable: No

I am new to blue prism development and any help would be appreciated. 
Thanks!
6 REPLIES 6

John__Carter
Staff
Staff
I'm not familiar with that VBO but my guess is that it contains code stages and a reference to that DLL file. The reference is telling BP to find the DLL on the local machine and the error is saying that BP can't find it.

Potential reasons for this could be - the file is not on the machine, the file is on the machine but not on the specified path, the path has not been specified and BP cannot find the file in the 'usual' locations (meaning the BP install folder or folders in the Windows PATH variable).

@WilliamHillman

Extract the attached zip file and place the dll at ​C:\Program Files\Blue Prism Limited\Blue Prism Automate
The VBO has a dependency on Renci.SshNet.dll. The steps to get the dll is also included in the User Guide.

Varad_Kale
Level 3

Hi @WilliamHillman ,

Were you able to resolve this issue?

I am trying to use this VBO, and I am facing this same issue.

If you have any suggestions, please let me know.

Thanks,

Varad

naveed_raza
Level 9

i already built re-usable object to work with SFTP , i can share the entire object, you have to paste that DLL in Blueprism automate folder

naveed_raza
Level 9

Below code will list files from SFTP to collection, you have to specify username , password , host and port number
note: below xml code is an action page from object. you can copy this paste directly in object, it will create new page with name called List Files.

here is the code option page, once you paste that DLL in blueprism automate folder, add below name spaces

naveed_raza_0-1769774932250.png


all these actions you can do

naveed_raza_1-1769774972181.png

<process name="__selection__RPA - Utility - SFTP" type="object">
  <subsheet subsheetid="7072573e-ce65-428e-b6d8-d0b802ccf618" type="Normal" published="True">
    <name>List Files</name>
    <view>
      <camerax>0</camerax>
      <cameray>7</cameray>
      <zoom version="2">1.25</zoom>
    </view>
  </subsheet>
  <stage stageid="4636b57e-91ad-47c7-81e5-b4a3bd7d55c6" name="List Files" type="SubSheetInfo">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <narrative>Set Variables  - call me first</narrative>
    <display x="-195" y="-105" w="150" h="90" />
  </stage>
  <stage stageid="902ae425-a39a-44b0-aba7-2b79c266859e" name="Start" type="Start">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <narrative>Execute's command on remote server using SSH</narrative>
    <display x="75" y="-105" />
    <inputs>
      <input type="text" name="Host" narrative="Hostname or IP address of the remote server" stage="Host" />
      <input type="text" name="Username" narrative="Username for the remote server login" stage="Username" />
      <input type="password" name="Password" narrative="Password for the remote server login" stage="Password" />
      <input type="text" name="Private Key FilePath" narrative="Private Key FilePath stored locally" stage="Private Key FilePath" />
      <input type="number" name="Port" narrative="sepecial port, if needed. Defaults to 22" stage="Port" />
      <input type="text" name="Remote Directory" narrative="Directory path on remote server" stage="remoteDirectory" />
    </inputs>
    <onsuccess>c9ea7f46-494a-45ba-9773-d9dc82fa0626</onsuccess>
  </stage>
  <stage stageid="95a4afa9-0a1c-440d-8673-d5dc958b0db9" name="End" type="End">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <narrative>End of action</narrative>
    <display x="75" y="45" />
    <outputs>
      <output type="flag" name="Success" stage="Success" />
      <output type="text" name="ErrorMessage" stage="ErrorMessage" />
      <output type="collection" name="fileList" stage="fileList" />
      <output type="number" name="fileListCount" stage="fileListCount" />
    </outputs>
  </stage>
  <stage stageid="3e0167a4-5a08-492d-8e3c-f215f91ff344" name="Input Data Items" type="Block">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-300" y="30" w="210" h="60" />
    <font family="Segoe UI" size="10" style="Regular" color="FFCC00" />
  </stage>
  <stage stageid="25de69a1-76d5-4047-b3a9-176970bb089a" name="Local Data Items" type="Block">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-300" y="-45" w="210" h="60" />
    <font family="Segoe UI" size="10" style="Regular" color="339966" />
  </stage>
  <stage stageid="18867604-cb05-4d55-8a4b-7b85f5e46388" name="Output Data Items" type="Block">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-300" y="105" w="210" h="105" />
    <font family="Segoe UI" size="10" style="Regular" color="993300" />
  </stage>
  <stage stageid="c9ea7f46-494a-45ba-9773-d9dc82fa0626" name="List Files" type="Code">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <narrative>Deletes file from remote directory</narrative>
    <display x="75" y="-30" />
    <inputs>
      <input type="text" name="Username" expr="[Username]" />
      <input type="text" name="Host" expr="[Host]" />
      <input type="text" name="keyLocation" expr="[Private Key FilePath]" />
      <input type="password" name="Password" expr="[Password]" />
      <input type="number" name="Port" expr="[Port]" />
      <input type="text" name="remoteDirectory" expr="[remoteDirectory]" />
    </inputs>
    <outputs>
      <output type="flag" name="Success" stage="Success" />
      <output type="text" name="ErrorMessage" stage="ErrorMessage" />
      <output type="collection" name="fileList" stage="fileList" />
      <output type="number" name="fileListCount" stage="fileListCount" />
      <output type="collection" name="dFileList" stage="dFileList" />
    </outputs>
    <onsuccess>95a4afa9-0a1c-440d-8673-d5dc958b0db9</onsuccess>
    <code><![CDATA[
Dim sftpClient as SftpClient = Nothing
Dim files As New DataTable()

Dim dt as New DataTable()
dt.Columns.Add("Name")
dt.Columns.Add("FullName")
dt.Columns.Add("Size")
dt.Columns.Add("LastWriteTime")

Try
	Success = True
	ErrorMessage = ""

    Dim connectionInfo As ConnectionInfo
    connectionInfo = getConnInfo(Host, Port, Username, Password, keyLocation)
    sftpClient = New SftpClient(connectionInfo)
    sftpClient.Connect()

	files = listFiles(sftpClient, remoteDirectory)

	fileList = files
	fileListCount = files.Rows.Count

	dim dFiles = sftpClient.ListDirectory(remoteDirectory)
	for each f in dFiles
		if f.Name <> "." AndAlso f.Name <> ".." then
			dt.Rows.Add(f.Name, f.FullName, f.Length.ToString(), f.LastWriteTime.ToString())
		end if
	next

	dFileList = dt

    sftpClient.Disconnect()

	
	

Catch Ex As Exception
	Success = false
    ErrorMessage = Ex.Message

End Try
]]></code>
  </stage>
  <stage stageid="f044e792-a0a3-48ae-9ecb-0bb5daca84c9" name="ErrorMessage" type="Data">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-150" y="135" w="90" h="30" />
    <datatype>text</datatype>
    <initialvalue />
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="16b7c632-6b23-450f-9423-917154f20971" name="Success" type="Data">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-240" y="135" w="90" h="30" />
    <datatype>flag</datatype>
    <initialvalue />
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="9fd2b475-5c8f-41dd-a3af-f290a642a511" name="remoteDirectory" type="Data">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-210" y="60" w="120" h="30" />
    <datatype>text</datatype>
    <initialvalue xml:space="preserve">/yourmftservername/yourfoldername</initialvalue>
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="f89c1f28-9d99-4e4b-bbf1-01ad7d494065" name="fileList" type="Collection">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-240" y="180" w="90" h="30" />
    <datatype>collection</datatype>
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="14fa74aa-28ca-4325-ae56-cf25483a4b88" name="fileListCount" type="Data">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="-150" y="180" w="90" h="30" />
    <datatype>number</datatype>
    <initialvalue>0</initialvalue>
    <private />
    <alwaysinit />
  </stage>
  <stage stageid="e2c659cc-ac66-4603-b0bb-5925ad5559b9" name="dFileList" type="Collection">
    <subsheetid>7072573e-ce65-428e-b6d8-d0b802ccf618</subsheetid>
    <loginhibit onsuccess="true" />
    <display x="150" y="-30" />
    <datatype>collection</datatype>
    <private />
    <alwaysinit />
  </stage>
</process>

 

naveed_raza
Level 9

naveed_raza_2-1769775531880.png