Hi @ Shane Rowley (Data Sagacity),
Your issue clearly states that there are multiple references to .net6, even after upgrading it to .net8. I would suggest you to clean the project at once and rebuild it , so that only new packages in the project's csproj will be published.
First remove all the unwanted files and double files and then clean and rebuild the project:
And also this HttpResponseData
is in lower version of .net and not in .net 8. So try to update your code as 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 FunctionApp3
{
public static class Function1
{
[FunctionName("Function1")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger rilg)
{
rilg.LogInformation("C# HTTP trigger function processed a request.");
string responseMessage = "Hello Rithwik";
return new OkObjectResult(responseMessage);
}
}
}
Try below commands:
dotnet clean
rd /s /q bin
rd /s /q obj
dotnet restore
dotnet build
Also update all the nuget packages as below:
As the issue is in local environment, I would suggest you to trouble shoot all the possible ways and last resort would be creating a new .net8 project and adding your functions over there.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.