When upgrading to .NET 8, class-based activities and orchestrators (using Microsoft.DurableTask.Generators) are not recognized anymore by the runtime.
Expected behavior
Activities and orchestrators should become visible in list of functions when function app is running.
Actual behavior
Activities and orchestrators are not recognized and trying to start an orchestration does not result in an error, but nothing happens.
Relevant source code snippets
After creating a new .NET 8 function app in Visual Studio, add <PackageReference Include="Microsoft.DurableTask.Generators" Version="1.0.0-preview.1" /> to csproj and convert the sample code to:
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.DurableTask;
using Microsoft.DurableTask.Client;
namespace Fun;
public static class Function1
{
[Function("Function1_HttpStart")]
public static async Task<HttpResponseData> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req,
[DurableClient] DurableTaskClient client)
{
// this is a generated method which indicates that the generator works
var instanceId = await client.ScheduleNewWorkflowInstanceAsync("");
return client.CreateCheckStatusResponse(req, instanceId);
}
}
[DurableTask(nameof(SayHelloActivity))]
public class SayHelloActivity : TaskActivity<string, string>
{
public override async Task<string> RunAsync(TaskActivityContext context, string input)
{
return input;
}
}
[DurableTask(nameof(Workflow))]
public class Workflow : TaskOrchestrator<string, string[]>
{
public override async Task<string[]> RunAsync(TaskOrchestrationContext context, string input)
{
var outputs = new List<string>
{
// also generated methods
await context.CallSayHelloActivityAsync("Tokyo"),
await context.CallSayHelloActivityAsync("Seattle"),
await context.CallSayHelloActivityAsync("London")
};
return [.. outputs];
}
}
Known workarounds
Use Function-based variants but that defeats the purpose.
Description
When upgrading to .NET 8, class-based activities and orchestrators (using Microsoft.DurableTask.Generators) are not recognized anymore by the runtime.
Expected behavior
Activities and orchestrators should become visible in list of functions when function app is running.
Actual behavior
Activities and orchestrators are not recognized and trying to start an orchestration does not result in an error, but nothing happens.
Relevant source code snippets
After creating a new .NET 8 function app in Visual Studio, add
<PackageReference Include="Microsoft.DurableTask.Generators" Version="1.0.0-preview.1" />
to csproj and convert the sample code to:Known workarounds
Use Function-based variants but that defeats the purpose.
App Details
runtime
packages
Screenshots