.NET 8 upgrade from .NET 6 of my azure function app didn't upgrade .azurefunctions

Duminda Jayasuriya 5 Reputation points
2024-11-04T09:01:54.7266667+00:00

Hi,

I recently upgraded from .NET 6 to .NET 8 using .NET upgrade assistant. Though I can see the Target Framework from visual studio as .NET 8, The file myProjectTriggerApp > bin > Debug > net8.0 > .azurefunctions > function.deps still shows something like below

"runtimeTarget": { 


"name": ".NETCoreApp,Version=v6.0", 

"signature": "" 
  }, 

  "compilationOptions": {}, 

  "targets": { 

yaml
".NETCoreApp,Version=v6.0": { 

  "Microsoft.Azure.Functions.Worker.Extensions/1.0.0": { 

    "dependencies": { 

      "Microsoft.Azure.WebJobs.Extensions.ServiceBus": "5.16.4", 

      "Microsoft.NET.Sdk.Functions": "4.3.0", 

      "Microsoft.NETCore.Targets": "3.0.0" 

    }, 

    "runtime": { 

      "Microsoft.Azure.Functions.Worker.Extensions.dll": {} 

    } 

  }, ....

but myProjectTriggerApp > bin> Debug > net8.0 > myProjectTriggerApp.deps shows something like

"runtimeTarget": { 

"name": ".NETCoreApp,Version=v8.0", 

"signature": "" 
  }, 

  "compilationOptions": {}, 

  "targets": { 

yaml
".NETCoreApp,Version=v8.0": { 

  "DocGenServiceBusTriggerApp/1.0.0": { 

    "dependencies": { 

      "Cloud.Common": "1.0.0", 

      "Microsoft.Azure.Functions.Extensions": "1.1.0", 

      "Microsoft.Azure.Functions.Worker": "1.23.0", 

      "Microsoft.Azure.Functions.Worker.Extensions.Http": "3.2.0", 

      "Microsoft.Azure.Functions.Worker.Extensions.ServiceBus": "5.22.0", 

      "Microsoft.Azure.Functions.Worker.Sdk": "1.18.1", 

      "Microsoft.Extensions.Http": "8.0.1" 

    }, 

    "runtime": { 

      "DocGenServiceBusTriggerApp.dll": {} 

    } 

  }, .... 
How can I upgrade **function.dep**s to .NET 8
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,195 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,981 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,230 Reputation points Microsoft Employee
    2024-11-06T10:30:46.2966667+00:00

    Hello @Duminda Jayasuriya

    Hello! It seems like you have upgraded your Azure Function app from .NET 6 to .NET 8, but the .azurefunctions > function.deps file still shows the runtimeTarget as .NETCoreApp,Version=v6.0.

    The function.deps file is generated by the Microsoft.NET.Sdk.Functions NuGet package, which is responsible for generating the function.json and other files required for Azure Functions. To upgrade the function.deps file to .NET 8, you need to update the Microsoft.NET.Sdk.Functions NuGet package to version 4.0.1 or later. You can do this by opening the Package Manager Console in Visual Studio and running the following command:

    
    Alternatively, you can update the package through the NuGet Package Manager UI. After updating the package, rebuild your project and check the .azurefunctions > function.deps file again. It should now show the runtimeTarget as .NETCoreApp,Version=v8.0. That should help.
    
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.