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
with AOT set to true, the following Console App code (reading the PnP.Core settings from appsettings.json file) fails on the last line below:
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PnPCoreOptions))]
[DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(PnPCoreAuthenticationOptions))]
var host = Host.CreateDefaultBuilder()
.ConfigureServices((hostingContext, services) =>
{
var pnpConfig = hostingContext.Configuration.GetSection("PnPCore");
// Add the PnP Core SDK library services
services.AddPnPCore();
// Add the PnP Core SDK library services configuration from the appsettings.json file
services.Configure<PnPCoreOptions>(pnpConfig);
// Add the PnP Core SDK Authentication Providers
services.AddPnPCoreAuthentication();
// Add the PnP Core SDK Authentication Providers configuration from the appsettings.json file
services.Configure<PnPCoreAuthenticationOptions>(pnpConfig);
}).UseConsoleLifetime()
.Build();
using var scope = host.Services.CreateScope();
// Obtain a PnP Context factory
var pnpContextFactory = scope.ServiceProvider.GetRequiredService<IPnPContextFactory>();
// Use the PnP Context factory to get a PnPContext for the given configuration
using var context = await pnpContextFactory.CreateAsync("SiteToWorkWith")
with the message:
Reflection-based serialization has been disabled for this application.
Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' property.
Are there plans to move away from reflection based serialization on the PnPCoreOptions, or is there a workaround for the time being?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
with AOT set to true, the following Console App code (reading the PnP.Core settings from appsettings.json file) fails on the last line below:
with the message:
Are there plans to move away from reflection based serialization on the PnPCoreOptions, or is there a workaround for the time being?
thank you
Beta Was this translation helpful? Give feedback.
All reactions