Open abaazzi opened 4 months ago
Hello, at the moment no, as In-Process model is going to be deprecated beginning 10 November 2026.
If there will be enough requests, I will implement it, though I need to understand how many people need it.
@vitalybibikov I'm using in-process model in multiple solution. getting compatibility issue after upgrade to .Net 8
We are moving to .NET 8 because of the end-of-support for .NET 6/7. Switching to isolated model is too large a task for us at the moment. Since this project (v4) does not currently support the in-process model, we must stay at v3. Unfortunately there is a new issue with JsonSerializerOptions in .NET 8 that breaks v3. The issue is described here: https://github.com/dotnet/aspnetcore/issues/55692 with the simple solution/work-around noted in this comment: https://github.com/dotnet/aspnetcore/issues/55692#issuecomment-2392448375 It occurs in the AddSwashBuckle method: If version 3 could be updated with the TypeInfoResolver initialized on JsonSerializerOptions in this mehtod, that would be great.
Wow, the referenced issue was deleted just now! That makes no sense to me. Anyway I had it open in another tab and was able to save a copy of the page here: Dotnet 8 JsonSerializerOptions Breaking change · Issue #55692 · dotnet_aspnetcore.pdf The last comment has the solution.
EDIT: ... and now it's undeleted. Oh, well.
That's so needed in our project that has multiple micro services that use in-process model
we can't migrate all the project to .Net 8 and to be isolated model in specific
Hi, I’m facing the same issue. We have nearly 20 projects that rely on the in-process model, so it would be really helpful if support for the latest version, which is currently compatible only with the isolated worker model in Azure Functions, could be added
We are also facing the same issue in .Net8 Inproc mode. Since we have time till 2026 for inproc, could you please release the fix for InProc mode ?
Same here, we are migrating in-proc AZ functions to dotnet8
in-proc
support. Please support this as well.
Thanks
@vitalybibikov , can you please at least patch the 3.3.2
by changing
SystemTextJsonOutputFormatter implementationInstance = new SystemTextJsonOutputFormatter(new JsonSerializerOptions());
to
SystemTextJsonOutputFormatter implementationInstance = new SystemTextJsonOutputFormatter(new JsonSerializerOptions({
TypeInfoResolver = new DefaultJsonTypeInfoResolver();
}));
in AddSwashBuckle
method .
Our current workaround may be helpful for some of you.
internal class SwashbuckleStartup : FunctionsStartup {
public override void Configure(IFunctionsHostBuilder builder) {
// https://github.com/vitalybibikov/AzureExtensions.Swashbuckle/issues/117
// https://github.com/dotnet/aspnetcore/issues/55692
// builder.AddSwashBuckle(Assembly.GetExecutingAssembly());
AddSwashBuckleCustom(builder, Assembly.GetExecutingAssembly());
}
public static IFunctionsHostBuilder AddSwashBuckleCustom(IFunctionsHostBuilder builder, Assembly assembly, Action<SwaggerDocOptions> configureDocOptionsAction = null) {
AddSwashBuckleCustom(builder.Services, assembly, configureDocOptionsAction);
return builder;
}
public static IServiceCollection AddSwashBuckleCustom(IServiceCollection services, Assembly assembly,
Action<SwaggerDocOptions> configureDocOptionsAction = null, IWebJobsBuilder webJobsBuilder = null) {
webJobsBuilder ??= services.AddWebJobs(_ => { });
webJobsBuilder.AddExtension<SwashbuckleConfig>()
.BindOptions<SwaggerDocOptions>()
.ConfigureOptions<SwaggerDocOptions>((configuration, section, options) => configureDocOptionsAction?.Invoke(options));
services.AddSingleton<IModelMetadataProvider>(new EmptyModelMetadataProvider());
services.AddSingleton(new SwashBuckleStartupConfig {
Assembly = assembly
});
var formatter = new SystemTextJsonOutputFormatter(new JsonSerializerOptions() {
TypeInfoResolver = new DefaultJsonTypeInfoResolver() // This is required in .NET 8 but is not part of the SwashBuckle v3 implementation.
});
services.AddSingleton<IOutputFormatter>(formatter);
// Below is reflection implementation of this:
// services.AddSingleton<IApiDescriptionGroupCollectionProvider, FunctionApiDescriptionProvider>();
Type providerInterfaceType = typeof(IApiDescriptionGroupCollectionProvider);
Type providerType = typeof(SwashBuckleStartupExtension).Assembly.GetType("AzureFunctions.Extensions.Swashbuckle.SwashBuckle.Providers.FunctionApiDescriptionProvider");
MethodInfo method=typeof(ServiceCollectionServiceExtensions).GetMethod(nameof(ServiceCollectionServiceExtensions.AddSingleton), 2,
BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(IServiceCollection) }, null);
MethodInfo genericMethod = method.MakeGenericMethod(providerInterfaceType, providerType);
genericMethod.Invoke(null, new object[] { services });
return services;
}
}
Hi, The last version is compatible only with isolated worker model in azure function, is there something planned for in-process model?