Skip to content

Commit

Permalink
add target framework to error
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmrdavid authored Sep 30, 2024
1 parent ed4a350 commit 3127b46
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/WebJobs.Extensions.DurableTask/DurableTaskExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

// debugging
using System.Reflection;
using System.Runtime.Versioning;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask
{
/// <summary>
Expand Down Expand Up @@ -447,10 +451,15 @@ void IExtensionConfigProvider.Initialize(ExtensionConfigContext context)
this.taskHubWorker.AddOrchestrationDispatcherMiddleware(ooprocMiddleware.CallOrchestratorAsync);
this.taskHubWorker.AddEntityDispatcherMiddleware(ooprocMiddleware.CallEntityAsync);
#else

var targetFramework = Assembly.GetEntryAssembly()?
.GetCustomAttribute<TargetFrameworkAttribute>()?
.FrameworkName;

// This can happen if, for example, a Java user tries to use Durable Functions while targeting V2 or V3 extension bundles
// because those bundles target .NET Core 2.2, which doesn't support the gRPC libraries used in the modern out-of-proc implementation.
throw new PlatformNotSupportedException(
"This project type is not supported on this version of the Azure Functions runtime. Please upgrade to Azure Functions V3 or higher. " +
$"{targetFramework}. This project type is not supported on this version of the Azure Functions runtime. Please upgrade to Azure Functions V3 or higher. " +
"If you are using a language that supports extension bundles, please use extension bundles V4 or higher. " +
"For more information on Azure Functions versions, see https://docs.microsoft.com/azure/azure-functions/functions-versions. " +
"For more information on extension bundles, see https://docs.microsoft.com/azure/azure-functions/functions-bindings-register#extension-bundles.");
Expand Down

0 comments on commit 3127b46

Please sign in to comment.