azure-functions-templates
azure-functions-templates copied to clipboard
'Run': cannot declare instance members in a static class
Originally posted by @titouancreach in https://github.com/microsoft/vscode-azurefunctions/issues/3012#issue-1066919604
Hello,
I juste created a new function via the vs code extension:
version of the extension: v1.6.0 type of azure function: dotnet 6 (not isolated), azure bus queue trigger function host : ~4 langage: C#
the code generated is:
using System; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Host; using Microsoft.Extensions.Logging; namespace XXXXX.Function { public static class Feedback { [FunctionName("Feedback")] public void Run([ServiceBusTrigger("googlefeedbacknotificationdev", Connection = "xxxxx_SERVICEBUS")]string myQueueItem, ILogger log) { log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}"); } } }
I got an error on the first run: error CS0708: 'Run': cannot declare instance members in a static class
This not a big deal for me to solve, but it may indicate a bug in the extension (maybe :))
Thanks 👍
The issue is a duplicate for #1143