diff --git a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs index fe605334..957b1469 100644 --- a/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs +++ b/src/NServiceBus.AzureFunctions.InProcess.ServiceBus/ServiceBusTriggeredEndpointConfiguration.cs @@ -131,6 +131,10 @@ static string GetConfiguredValueOrFallback(IConfiguration configuration, string /// Attempts to derive the required configuration parameters automatically from the Azure Functions related attributes via /// reflection. /// + [ObsoleteEx( + Message = "The static hosting model has been deprecated. Refer to the documentation for details on how to use class-instance approach instead.", + RemoveInVersion = "3", + TreatAsErrorFromVersion = "2")] public static ServiceBusTriggeredEndpointConfiguration FromAttributes() { var serviceBusTriggerAttribute = ReflectionHelper.FindBusTriggerAttribute(); diff --git a/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt b/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt index 625ba113..750c7ecf 100644 --- a/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt +++ b/src/ServiceBus.Tests/ApprovalFiles/APIApprovals.Approve.approved.txt @@ -84,6 +84,9 @@ namespace NServiceBus where T : NServiceBus.Serialization.SerializationDefinition, new () { } protected NServiceBus.TransportExtensions UseTransport() where TTransport : NServiceBus.Transport.TransportDefinition, new () { } + [System.Obsolete("The static hosting model has been deprecated. Refer to the documentation for deta" + + "ils on how to use class-instance approach instead. Will be treated as an error f" + + "rom version 2.0.0. Will be removed in version 3.0.0.", false)] public static NServiceBus.ServiceBusTriggeredEndpointConfiguration FromAttributes() { } } } \ No newline at end of file