I am trying to run my Azure Function project using Storage Emulator, but I'm getting the following error:
System.MethodAccessException: 'Attempt by method 'Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener+
It's a queue trigger, pointing to storage emulator.
Here's the stack trace:
at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.ExecuteAsync(CancellationToken cancellationToken) in C:\projectsazure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\Listeners\QueueListener.cs:line 181
at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.RunAsync(CancellationToken cancellationToken) in C:\projectsazure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Timers\TaskSeriesTimer.cs:line 147
at Microsoft.Azure.WebJobs.Host.Timers.WebJobsExceptionHandler.<>c__DisplayClass3_0.
at System.Threading.Thread.ThreadMain_ThreadStart()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
i had the same issue, i downgraded Microsoft.Azure.WebJobs.Extensions.Storage to 3.0.2 and the issue was fixed.
Microsoft.Azure.WebJobs.Extensions.Storage 3.0.6 works fine.
Clearly there is something wrong with version 3.0.7
What version of the CLI are you running? That method was added in a more recent version. The VS tools should auto-update it for you but if you're running the CLI directly, you should update.
@brettsam at this moment, when I was trying to run it, VS started to update to latest version of cli, even tough I've updated a few days ago. Is there a way to get the current version without running it through VS?
Azure Functions CLI - 1.0.12
Azure Functions Tools -2.32.0
Azure Storage Emulator - AzureStorageEmulator.5.10
@brettsam ?
What does it say when you start up the CLI?
For example...
Azure Functions Core Tools (2.7.1585 Commit hash: 9a2b7239b937148e3b76e6f7999798629a82134a)
Function Runtime Version: 2.0.12641.0
@brettsam at this moment if I try to run, it will download the latest version. Any way, try to reproduce with the information I've provided above. I'll let it upgrade and see if the problem is solved while that
Functions VS Tools 2.32 -> Functions Core Tools 2.7.1575 -> Functions Host 2.0.12641, which should work. The LogName property was added the build before this. The latest storage extension uses that property, so if the host version you're running is earlier, it won't be found.
Azure Functions CLI - 1.0.12, I believe is for v1 only won't work (it's a year old).
The best way to tell what's you're using is via the startup output line above. We've got a lot of versions of different pieces and it can be hard to piece together what's actually running sometimes.
Using the latest VS tools and hitting F5 with the latest storage extension has been working for me.
I had to update to the latest version. Can't tell you what version was, but maybe @Spharah can give this information
@thdotnet & @Spharah Please reach out to us if you have additional questions,closing this as answered based on the information above.
Thank You!
Most helpful comment
Microsoft.Azure.WebJobs.Extensions.Storage 3.0.6 works fine.