问题
my Azure function is v2.
I have added <PackageReference Include="SSH.NET" Version="2016.1.0" />
into ItemGroup in function.proj.
However, #r "Renci.SshNet"
is NOT working. #r "D:\home\site\wwwroot\bin\Renci.SshNet.dll"
is NOT working either. Because there is no bin folder under wwwroot.
What is the normal way to include Renci.SshNet?
Regards, Zhenyu
my function.proj screenshot
回答1:
You can add bin folder under wwwroot and drag the dll to it by "Advanced tools(kudu)" under azure function "Platform features" tag.
First, click "kudu" (shown as below screenshot)
Then click "Debug console" --> "CMD" --> "site" --> "wwwroot" --> "New folder" and namd the folder as "bin".
Then drag the dll file to the bin folder and then you can use it by #r command(shown as below)
Update:
You can try to modify your function.proj as below:
<PackageReference Include="Renci.SshNet.Async" Version="1.4.0" />
And in your function use the command "using Renci.SshNet;".
And remove the #r line of Renci.SshNet you added before.
Please have a try.
来源:https://stackoverflow.com/questions/57966783/how-can-i-add-ssh-net-nuget-packages-into-my-azure-functions-v2-0