Recently, I converted an Azure Function that used a C# script (*.csx
) to a pre-complied class library using the Visual Studio Studio Tools for Azure Functions. It builds successfully in Visual Studio 2017 (as well as running and debugging too).
I'd like to build this AF library via our CI process. However, when I run the command dotnet build
locally it fails with the following error:
C:\Users\ray\.nuget\packages\microsoft.net.sdk.functions\1.0.2\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(31,5): error : Could not load file or assembly 'Microsoft.Azure.WebJobs.Host, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
The same error also occurs in our CI build.
Not sure why this error is occurring and how to resolve it. Is it the version of the dotnet CLI (I'm using v1.1)? Is it something else?