Blog Post
Logic Apps Standard custom code now supports .NET 10
I get a build error in my GitHub Actions workflow when building my .NET 10 custom code project with the Release configuration using "dotnet build --configuration Release". I think it's because .NET 11 is preinstalled on the agent. I explicitely install .NET 10, but "11.0.100" is returned when executing "dotnet --version".
I have .NET 11 installed on my local machine and I can reproduce the issue by executing "dotnet build --configuration Release" from a normal Windows Terminal. This is the error output.
Restore complete (0,0s)
WorkerExtensions net8.0 succeeded (1,3s) → obj\Release\net10.0\WorkerExtensions\bin\Release\net8.0\Microsoft.Azure.Functions.Worker.Extensions.dll
Functions net10.0 failed with 1 error(s) (0,4s) → bin\Release\net10.0\publish\
C:\Users\...\.nuget\packages\microsoft.azure.workflows.webjobs.sdk\1.4.0\build\Microsoft.Azure.Workflows.WebJobs.Sdk.targets(55,9): error Failed to process the functions.metadata at the following location: C:\...\azure-logicappsstandard-azd-extension-sample\src\logicAppWithCode\Functions\bin\Release\net10.0\. Exception: 'Failed to load the assembly named C:\...\azure-logicappsstandard-azd-extension-sample\src\logicAppWithCode\Functions\bin\Release\net10.0\Functions.dll. Exception: 'Could not load file or assembly 'Functions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. A different copy of assembly 'Functions' is already loaded. Loaded assembly: 'Functions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' from 'C:\...\azure-logicappsstandard-azd-extension-sample\src\logicAppWithCode\Functions\bin\Debug\net10.0\Functions.dll'''
Build failed with 1 error(s) in 2,0s
When I execute "dotnet build" without release configuration from the Windows Terminal, the build succeeds.
When I execute 'dotnet --list-sdks' in my Windows Terminal, I get these SDKS:
10.0.403 [C:\Program Files\dotnet\sdk]
10.0.404 [C:\Program Files\dotnet\sdk]
11.0.100 [C:\Program Files\dotnet\sdk]
When I execute "dotnet build --configuration Release" from a terminal in VS Code, it succeeds because it uses the installed .NET SDKs from the Logic App extension. When I execute 'dotnet --list-sdks', I get these SDKS:
6.0.428 [C:\Users\...\.azurelogicapps\dependencies\DotNetSDK\sdk]
8.0.427 [C:\Users\...\.azurelogicapps\dependencies\DotNetSDK\sdk]
10.0.403 [C:\Users\...\.azurelogicapps\dependencies\DotNetSDK\sdk]
By adding a global.json with the following contents to my Logic App's workspace folder, "dotnet build --configuration Release" succeeds from my normal Windows Terminal as well.
{
"sdk": {
"version": "10.0.403",
"rollForward": "latestFeature"
}
}