Errors
error NU1100: Unable to resolve 'Microsoft.NET.Sdk.Functions (>= 3.1.1)' for '.NETCoreApp,Version=v3.1'
error NU1100: Unable to resolve 'Microsoft.NETCore.App.Ref (= 3.1.0)' for '.NETCoreApp,Version=v3.1'
error NU1100: Unable to resolve 'Microsoft.WindowsDesktop.App.Ref (= 3.1.0)' for '.NETCoreApp,Version=v3.1'
error NU1100: Unable to resolve 'Microsoft.AspNetCore.App.Ref (= 3.1.10)' for '.NETCoreApp,Version=v3.1'
I'm working on a project to build a website and add azure function that will have a counter of how many people have visited the site. I am stuck at this point https://youtu.be/ieYrBWmkfno?t=1879. This is where I'm getting my error. I found a similar post here NU1100:Unable to resolve 'Microsoft.NET.Sdk.Functions (>= 3.0.3)' for '.NETCoreApp,Version=v3.1' . I will be honest I don't know enough about what I'm doing to even troubleshoot it. I'm using vscode and git bash as a terminal. I tried:
- Resolving the dependencies
- Downloading and installing the .net 6.0 sdk and runtime
- Originally I tried this with .net version 6 when I was creating the azure function but the video used 3.0 lts so I changed it 3.1
- Downloading and installing the nuget
Any help would be appreciated. This is also my first post here so I did my best to follow the question guidelines
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 Company.Function
{
public static class GetResumeCounter
{
[FunctionName("GetResumeCounter")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string name = req.Query["name"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
name = name ?? data?.name;
string responseMessage = string.IsNullOrEmpty(name)
? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
: $"Hello, {name}. This HTTP triggered function executed successfully.";
return new OkObjectResult(responseMessage);
}
}
}

