Hi,
You need to remove the AbpStringToEnumFactory
Just an example:
public class EnumToStringConverterFactory : JsonConverterFactory
{
public override bool CanConvert(Type typeToConvert)
{
return typeToConvert.IsEnum;
}
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
{
return (JsonConverter)Activator.CreateInstance(
typeof(MyEnumToStringConverter<>).MakeGenericType(typeToConvert),
BindingFlags.Instance | BindingFlags.Public,
binder: null,
new object?[] { },
culture: null)!;
}
}
public class MyEnumToStringConverter<T> : JsonConverter<T>
where T : struct, Enum
{
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
return Enum.Parse<T>(reader.GetString()!);
}
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
{
writer.WriteStringValue(value.ToString());
}
}
Configure<AbpSystemTextJsonSerializerOptions>(options =>
{
var stringToEnumFactory = options.JsonSerializerOptions.Converters.Single(x => x.GetType() == typeof(AbpStringToEnumFactory));
options.JsonSerializerOptions.Converters.Remove(stringToEnumFactory);
options.JsonSerializerOptions.Converters.Add(new EnumToStringConverterFactory());
});
Configure<JsonOptions>(options =>
{
var stringToEnumFactory = options.JsonSerializerOptions.Converters.Single(x => x.GetType() == typeof(AbpStringToEnumFactory));
options.JsonSerializerOptions.Converters.Remove(stringToEnumFactory);
options.JsonSerializerOptions.Converters.Add(new EnumToStringConverterFactory());
});
If you're getting license error with ABP v8.0 at nightly packages run the project in Release mode: 1-) dotnet run -c Release 2-) Set your environment variable ASPNETCORE_ENVIRONMENT=Release You need to configure these 2 options to Release otherwise you'll get error.
Try
AsyncHelper.RunSync(() => app.ApplicationServices.GetRequiredService<IPermissionDefinitionManager>().GetGroupsAsync());
Hi,
We have no plan to do it.
Hi,
We have done it for the ABP framework https://github.com/abpframework/abp/pull/17870
It's good to manage the package versions, you can also do it for your project if you want.
Hi,
Could you provide the full steps to reproduce the problem? I will check it. thanks
Hi,
You should customize the login page in the AuthServer (Or HttpApi.Host if not Tiered) project.
HI,
You can check this: https://github.com/abpframework/abp/issues/13010