Eugene
Eugene

Reputation: 1125

Unable to install nuget package into azure function

I am just starting to use Azure functions in the logic apps.I have created a function that i am trying to use a Nuget package HTMLAgilityPack and getting it install via the console (in classic view). But it mentions that no project found?

enter image description here

Upvotes: 1

Views: 985

Answers (1)

Joey Cai
Joey Cai

Reputation: 20067

To use NuGet packages in a 2.x and later C# function, upload a function.proj file to the function's folder in the function app's file system. Here is an example function.proj file that adds a reference to HtmlAgilityPack version 1.11.24:

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>netstandard2.0</TargetFramework>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="HtmlAgilityPack" Version="1.11.24" />
    </ItemGroup>
</Project>

enter image description here

And add using HtmlAgilityPack; above the code, refer to the snapshot as below:

enter image description here

Upvotes: 1

Related Questions