LittleFunny
LittleFunny

Reputation: 8375

Azure Function: Could not load file or assembly WebJobs.Host

I have an error saying

Error: The function runtime is unable to start. mscorlib: Could not load file or assembly 'Microsoft.Azure.WebJobs.Host, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

Do I need to setup anything in the azure portal? I can run it on my local machine. After I published the function to azure and tried to run the function it gave me this error.

Upvotes: 2

Views: 5294

Answers (3)

Jim Speaker
Jim Speaker

Reputation: 1332

If you are running Functions V2 you need to ensure that the Function App's "FUNCTIONS_EXTENSION_VERSION" Application Setting on Azure is set to a value of "~2". It seems to default to "~1" - you can modify the value manually or through your automated release process (CD).

HTH

Upvotes: 1

scottrudy
scottrudy

Reputation: 1742

I ran into this same issue locally and solved it by clearing my local nuget cache. See How to clear NuGet package cache using command line?

Upvotes: 1

LittleFunny
LittleFunny

Reputation: 8375

I removed the azure function created previously and create a new one from Visual Studio by creating a azure function project and publish from there.

Upvotes: 0

Related Questions