diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs index bd88c55cb8..c416fb6a2a 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/SamplesValidation.cs @@ -21,6 +21,12 @@ public sealed class SamplesValidation(ITestOutputHelper outputHelper) : IAsyncLi private const string RedisPort = "6379"; private static readonly string s_dotnetTargetFramework = GetTargetFramework(); + +#if DEBUG + private const string BuildConfiguration = "Debug"; +#else + private const string BuildConfiguration = "Release"; +#endif private static readonly HttpClient s_sharedHttpClient = new(); private static readonly IConfiguration s_configuration = new ConfigurationBuilder() @@ -825,7 +831,7 @@ private async Task BuildSampleAsync(string samplePath) ProcessStartInfo buildInfo = new() { FileName = "dotnet", - Arguments = $"build -f {s_dotnetTargetFramework}", + Arguments = $"build -f {s_dotnetTargetFramework} -c {BuildConfiguration}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, @@ -855,7 +861,7 @@ private Process StartFunctionApp(string samplePath, List logs) ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run --no-build -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", + Arguments = $"run --no-build -f {s_dotnetTargetFramework} -c {BuildConfiguration} --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true, diff --git a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs index d5ea083894..efb02b1aff 100644 --- a/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs +++ b/dotnet/tests/Microsoft.Agents.AI.Hosting.AzureFunctions.IntegrationTests/WorkflowSamplesValidation.cs @@ -20,6 +20,12 @@ public sealed class WorkflowSamplesValidation(ITestOutputHelper outputHelper) : private const string DtsPort = "8080"; private static readonly string s_dotnetTargetFramework = GetTargetFramework(); + +#if DEBUG + private const string BuildConfiguration = "Debug"; +#else + private const string BuildConfiguration = "Release"; +#endif private static readonly HttpClient s_sharedHttpClient = new(); private static readonly IConfiguration s_configuration = new ConfigurationBuilder() @@ -437,7 +443,7 @@ private Process StartFunctionApp(string samplePath, List logs, bool r ProcessStartInfo startInfo = new() { FileName = "dotnet", - Arguments = $"run -f {s_dotnetTargetFramework} --port {AzureFunctionsPort}", + Arguments = $"run -f {s_dotnetTargetFramework} -c {BuildConfiguration} --port {AzureFunctionsPort}", WorkingDirectory = samplePath, UseShellExecute = false, RedirectStandardOutput = true,