'v2 Function Could not load type 'Microsoft.Azure.WebJobs.QueueTriggerAttribute'

V2 App that used to work. When I try to run it now I get the following error:

Microsoft.Azure.WebJobs.Host: Error indexing method 'MyClass.Run'. System.Private.CoreLib: Could not load type 'Microsoft.Azure.WebJobs.QueueTriggerAttribute' from assembly 'Microsoft.Azure.WebJobs, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null'.


May also show for Microsoft.Azure.WebJobs.BlobTriggerAttribute, Microsoft.Azure.WebJobs.BlobAttribute, Microsoft.Azure.WebJobs.TableAttribute, or Microsoft.Azure.WebJobs.QueueAttribute



Solution 1:[1]

There was a recent release of Azure Functions v2 preview detailed here which requires triggers and bindings that depend on storage to pull in an additional Azure Storage extension. The templates should reflect this change automatically.

To pull in yourself, get the Microsoft.Azure.WebJobs.Extensions.Storage Nuget Package.

For non-C# apps, running func extensions install should pull in the right storage extension.

Solution 2:[2]

FWIW: Switching Platform from 32 Bit to 64 Bit fixed this issue for me.enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Joshcodes