But after doing all these steps the build fails in VS (also tried it directly with the Azure Function Core Tools from cli, same results)
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : System.NullReferenceException: Object reference not set to an instance of an object.
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.AttributeExtensions.IsWebJobsAttribute(CustomAttribute attribute) in /_/src/Microsoft.NET.Sdk.Functions.Generator/AttributeExtensions.cs:line 52
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.ParameterInfoExtensions.<>c.<IsWebJobSdkTriggerParameter>b__0_0(CustomAttribute a) in /_/src/Microsoft.NET.Sdk.Functions.Generator/ParameterInfoExtensions.cs:line 19
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.ParameterInfoExtensions.IsWebJobSdkTriggerParameter(ParameterDefinition parameterInfo) in /_/src/Microsoft.NET.Sdk.Functions.Generator/ParameterInfoExtensions.cs:line 17
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.MethodInfoExtensions.<>c.<HasTriggerAttribute>b__4_0(ParameterDefinition p) in /_/src/Microsoft.NET.Sdk.Functions.Generator/MethodInfoExtensions.cs:line 41
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.MethodInfoExtensions.HasTriggerAttribute(MethodDefinition method) in /_/src/Microsoft.NET.Sdk.Functions.Generator/MethodInfoExtensions.cs:line 41
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.MethodInfoExtensions.HasValidWebJobSdkTriggerAttribute(MethodDefinition method) in /_/src/Microsoft.NET.Sdk.Functions.Generator/MethodInfoExtensions.cs:line 25
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.FunctionJsonConverter.GenerateFunctions(IEnumerable`1 types)+MoveNext() in /_/src/Microsoft.NET.Sdk.Functions.Generator/FunctionJsonConverter.cs:line 134
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons() in /_/src/Microsoft.NET.Sdk.Functions.Generator/FunctionJsonConverter.cs:line 194
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : at MakeFunctionJson.FunctionJsonConverter.TryRun() in /_/src/Microsoft.NET.Sdk.Functions.Generator/FunctionJsonConverter.cs:line 87
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Error generating functions metadata
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error :
7>C:\Users\Nikolaj\.nuget\packages\microsoft.net.sdk.functions\4.4.0\build\Microsoft.NET.Sdk.Functions.Build.targets(32,5): error : Metadata generation failed.
What I have tried:
All dependencies are updated.
Removed all old .NET SDKs + runtimes.
Running as admin, both from cli and VS.
Restarting PC multiple times.
Let me know if you need more information, would love to get our functions up and running with .NET8
Investigative information
Please provide the following:
Timestamp: 2024/06/21/12:31
Function App version: v4
Region: local env
Repro steps
Provide the steps required to reproduce the problem:
Build a .NET8 targetting in-process Azure Function C# project.
Expected behavior
Can build and run a .NET8 in-process Azure Function project.
I'm following the migration guide for updating a function to .NET8: https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library?tabs=v4%2Ccmd#updating-to-target-net-8
But after doing all these steps the build fails in VS (also tried it directly with the Azure Function Core Tools from cli, same results)
What I have tried:
Let me know if you need more information, would love to get our functions up and running with .NET8
Investigative information
Please provide the following:
Repro steps
Provide the steps required to reproduce the problem:
Build a .NET8 targetting in-process Azure Function C# project.
Expected behavior
Can build and run a .NET8 in-process Azure Function project.