You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing out durable tasks using isolated function in .NET 7
I seem to be having trouble building to project when I have a complex type as inputs parameters or return types for my activity functions.
[Function("CalculateBuyProbability")]
public static async Task<SentimentResult> Calculate([ActivityTrigger] int userId, ILogger log)
{
...
}
...
[Function("PrintReport")]
public static async Task Print([ActivityTrigger] List<SentimentResult> results, SentimentResult test, ILogger log)
{
...
}
SentimentResult here is a basic complex type
public class SentimentResult
{
public int UserId { get; set; }
public int Sentiment { get; set; }
}
I get build error:
C:\Users\niels\RiderProjects\TestApps\Company.FunctionApp1\Company.FunctionApp1\Microsoft.DurableTask.Generators\Microsoft.DurableTask.Generators.DurableTaskSourceGenerator\GeneratedDurableTaskExtensions.cs(13,33): error CS0246: The type or namespace name 'SentimentResult' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\niels\RiderProjects\TestApps\Company.FunctionApp1\Company.FunctionApp1\Company.FunctionApp1.cspro
j]
What I've tried:
Removing the ActivityTriggerAttribute fixes the build error
Returning object instead of complex type fixes the build error
I'm using Rider as my IDE, but I don't think it's related as dotnet build via terminal returns the same.
In case it matters, my csproj with the package versions I'm using:
I'm testing out durable tasks using isolated function in .NET 7
I seem to be having trouble building to project when I have a complex type as inputs parameters or return types for my activity functions.
SentimentResult
here is a basic complex typeI get build error:
C:\Users\niels\RiderProjects\TestApps\Company.FunctionApp1\Company.FunctionApp1\Microsoft.DurableTask.Generators\Microsoft.DurableTask.Generators.DurableTaskSourceGenerator\GeneratedDurableTaskExtensions.cs(13,33): error CS0246: The type or namespace name 'SentimentResult' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\niels\RiderProjects\TestApps\Company.FunctionApp1\Company.FunctionApp1\Company.FunctionApp1.cspro
j]
What I've tried:
ActivityTriggerAttribute
fixes the build errorobject
instead of complex type fixes the build errorI'm using Rider as my IDE, but I don't think it's related as
dotnet build
via terminal returns the same.In case it matters, my csproj with the package versions I'm using:
The text was updated successfully, but these errors were encountered: