Great
hi
I see, Please share the Program.cs
of your logistics.HttpApi.Host
project.
We need to output more logs.
Thanks.
hi
Can you share a screenshot of your solution structure?
How many web projects are in your solution?
hi
We will fix this in the next version. You can temporarily solve it by replace the CachedObjectExtensionsDtoService
https://github.com/abpframework/abp/pull/21675
using System;
using System.Collections.Generic;
using System.Linq;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending;
using Volo.Abp.DependencyInjection;
using Volo.Abp.ObjectExtending;
using Volo.Abp.ObjectExtending.Modularity;
namespace MyCompanyName.MyProjectName.Web;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(MyCachedObjectExtensionsDtoService), typeof(CachedObjectExtensionsDtoService), typeof(ICachedObjectExtensionsDtoService))]
public class MyCachedObjectExtensionsDtoService : CachedObjectExtensionsDtoService
{
public MyCachedObjectExtensionsDtoService(IExtensionPropertyAttributeDtoFactory extensionPropertyAttributeDtoFactory)
: base(extensionPropertyAttributeDtoFactory)
{
}
protected override void FillEnums(ObjectExtensionsDto objectExtensionsDto)
{
var enumProperties = ObjectExtensionManager.Instance.Modules().Values
.SelectMany(
m => m.Entities.Values.SelectMany(
e => e.GetProperties()
)
)
.Where(p => p.Type.IsEnum || IsNullableEnum(p.Type))
.ToList();
foreach (var enumProperty in enumProperties)
{
// ReSharper disable once AssignNullToNotNullAttribute (enumProperty.Type.FullName can not be null for this case)
objectExtensionsDto.Enums[enumProperty.Type.FullName!] = CreateExtensionEnumDto(enumProperty);
}
}
protected override ExtensionEnumDto CreateExtensionEnumDto(ExtensionPropertyConfiguration enumProperty)
{
var extensionEnumDto = new ExtensionEnumDto
{
Fields = new List<ExtensionEnumFieldDto>(),
LocalizationResource = enumProperty.GetLocalizationResourceNameOrNull()
};
var enumType = enumProperty.Type.IsEnum
? enumProperty.Type
: IsNullableEnum(enumProperty.Type)
? Nullable.GetUnderlyingType(enumProperty.Type)
: null;
if (enumType == null)
{
return extensionEnumDto;
}
foreach (var enumValue in enumType.GetEnumValues())
{
extensionEnumDto.Fields.Add(
new ExtensionEnumFieldDto
{
Name = enumType.GetEnumName(enumValue)!,
Value = enumValue
}
);
}
return extensionEnumDto;
}
public bool IsNullableEnum(Type type)
{
return type.IsGenericType &&
type.GetGenericTypeDefinition() == typeof(Nullable<>) &&
type.GenericTypeArguments.Length == 1 &&
type.GenericTypeArguments[0].IsEnum;
}
}
ok, You can try this solution. : )
Sorry for that.
: ) It will be fixed in the next patch Studio.
hi
I dont' have any logs.txt file in my development machine nor on the server i'm trying to deploy.
Please check your Program.cs
, the Logs.txt
is configured. You can set the .MinimumLevel.Debug()
to see more logs.
.WriteTo.Async(c => c.File("Logs/logs.txt"))
public class Program
{
public async static Task<int> Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateBootstrapLogger();
try
{
Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host
.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog((context, services, loggerConfiguration) =>
{
loggerConfiguration
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.WriteTo.Async(c => c.AbpStudio(services));
});
await builder.AddApplicationAsync<MyProjectNameWebModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
}
hi
They are only used in the Lepton
Theme. I will remove them if the current theme is not Lepton
.
Thanks.