vscode-azurefunctions icon indicating copy to clipboard operation
vscode-azurefunctions copied to clipboard

'Run': cannot declare instance members in a static class

Open titouancreach opened this issue 2 years ago • 0 comments

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 👍

titouancreach avatar Nov 30 '21 08:11 titouancreach