Reputation: 864
I'm trying to understand why vs-code is giving me this error
The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [AzureFunctions]csharp(CS0012) class Microsoft.Azure.WebJobs.FunctionNameAttribute (+ 1 overload)
on the following code. The error above comes from the [FunctionName("UploadGhost")] line below
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
namespace My.Functions
{
public static class UploadGhost
{
[FunctionName("UploadGhost")]
[StorageAccount("AzureWebJobsStorage")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
//[Blob("ghostsdev/{name}", FileAccess.Write)] out string ghostfile,
ILogger log,
IBinder binder)
{
...
I can "Go to definition" on FunctionName, and the function works when I deploy it, but for some reason VS Code still complains about it and the whole .cs script file is full of red underlines.
Upvotes: 0
Views: 616
Reputation: 864
fixed it by settings "Omnisharp: Use Global Mono" to "never" as was suggested here: https://github.com/OmniSharp/omnisharp-vscode/issues/3290
Upvotes: 1