Activities of "p.j.keukens"

Thanks for the help, by knowing what to check I was able to find the problem. One of the submodules was missing a typeof dependency.

  • ABP Framework version: v8.0.5
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • 2024-04-10 17:06:18.233 +02:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }

2024-04-10 17:06:18.234 +02:00 [ERR] The entity type 'ExtraPropertyDictionary' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943. System.InvalidOperationException: The entity type 'ExtraPropertyDictionary' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. For more information on keyless entity types, see https://go.microsoft.com/fwlink/?linkid=2141943. at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.ValidateNonNullPrimaryKeys(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.SqlServer.Infrastructure.Internal.SqlServerModelValidator.Validate(IModel model, IDiagnosticsLogger1 logger) at Microsoft.EntityFrameworkCore.Infrastructure.ModelRuntimeInitializer.Initialize(IModel model, Boolean designTime, IDiagnosticsLogger1 validationLogger) at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(DbContext context, ModelCreationDependencies modelCreationDependencies, Boolean designTime) at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel(Boolean designTime) at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__8_4(IServiceProvider p) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at ResolveService(ILEmitResolverBuilderRuntimeContext, ServiceProviderEngineScope) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices() at Microsoft.EntityFrameworkCore.DbContext.get_ChangeTracker() at Volo.Abp.EntityFrameworkCore.AbpDbContext1.Initialize(AbpEfCoreDbContextInitializationContext initializationContext) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.CreateDbContextAsync(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) at Volo.Abp.Uow.EntityFrameworkCore.UnitOfWorkDbContextProvider1.GetDbContextAsync() at Volo.Abp.Domain.Repositories.EntityFrameworkCore.EfCoreRepository2.GetDbSetAsync() at TestProject1.Claims.Claims.EfCoreClaimRepositoryBase.GetQueryForNavigationPropertiesAsync() in C:\SERVER\Innoview\Projects\VS2022\TestProject1\modules\TestProject1.Claims\src\TestProject1.Claims.EntityFrameworkCore\Claims\EfCoreClaimRepository.cs:line 52 at TestProject1.Claims.Claims.EfCoreClaimRepositoryBase.GetCountAsync(String filterText, String name, Nullable1 intermediaryId, CancellationToken cancellationToken) in C:\SERVER\Innoview\Projects\VS2022\TestProject1\modules\TestProject1.Claims\src\TestProject1.Claims.EntityFrameworkCore\Claims\EfCoreClaimRepository.cs:line 93 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at TestProject1.Claims.Claims.ClaimsAppServiceBase.GetListAsync(GetClaimsInput input) in C:\SERVER\Innoview\Projects\VS2022\TestProject1\modules\TestProject1.Claims\src\TestProject1.Claims.Application\Claims\ClaimsAppService.cs:line 42 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method6514(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • Steps to reproduce the issue:
  • Use ABP Suite to create a new application
  • Use ABP Suite to add 2 modules (ModA and ModB) to the new application
  • Use ABP Suite, open ModA, add a FullAuditedAggregateRoot named ObjA with Guid and one property: name (string). Save and Generate
  • Use ABP Suite, open ModB, add a FullAuditedAggregateRoot named ObjB with Guid and one property: name (string) and a Navigation property (1-N) to ObjA in ModA (using select file) then save and generate.
  • Open application in visual studio. Link ModA projects to ModB and make them required.
  • Add Migration and run the project, login and go to the main page for ModB (with the linked property), it will give the error [ERR] The entity type 'ExtraPropertyDictionary'

I have prepared a test project, that is fully configured and has this problem.

I did look at the items in the docs and samples etc, but couldn't find a good solution.

This problem started when I migrated my production project with about 10 modules in there from ABP version 7.0.3 to 8.0.5. After the migration I added a new module and linked it to one of my other modules. And added a 1-n navigation property from the new module to the old module.

I tried linking the DBContexts but that didn't solve the problem.

Here is the test project with the two modules, it also contains the log file with the error and the .suite entity defenitions.

https://www.dropbox.com/scl/fi/1675evyhkgmhw6hapal6j/TestProject1.zip?rlkey=2myio6depstr21zkzc8592mj4&dl=0

Ah yeah, stupid mistake by me... Thanks

@maliming just send you a freshly created project with the same problem.

  • ABP Framework version: v7.0.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes / no
  • Exception message and stack trace:
  • An exception was thrown while activating Castle.Proxies.ReferenceDataProxy. Autofac.Core.DependencyResolutionException: An exception was thrown while activating Castle.Proxies.ReferenceDataProxy. ---> Autofac.Core.DependencyResolutionException: None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Castle.Proxies.ReferenceDataProxy' can be invoked with the available services and parameters: Cannot resolve parameter 'ReferenceData.IReferenceDataRepository referenceDataRepository' of constructor 'Void .ctor(Castle.DynamicProxy.IInterceptor[], ReferenceData.IReferenceDataRepository)'.
  • Steps to reproduce the issue: Steps to reproduce:
  1. Have a tiered application using MVC and Ef-Core based on the application template
  2. Add a module and reference is from the main project
  3. In the EntityFrameworkCore project of the module add an entity and a repository class
  4. In the Domain project of the module add an interface
  5. In the Application module of the module create an AppService where the custom repository is injected
  6. Some how it cannot resolve the repository and I can't find the problem, if I use IRepository&lt;ReferenceData, string> directly in the AppService that works. But what am I missing that the custom repository isn't registered in the dependency Injection?

Here are the code definitions used:

//Repository in EntityFrameworkCore project of application module
public class EfCoreReferenceDataRepository : EfCoreRepository<ReferenceDbContext, ReferenceData, string>, IReferenceDataRepository
{
	public EfCoreReferenceDataRepository(IDbContextProvider<ReferenceDbContext> dbContextProvider)
		: base(dbContextProvider)
	{
	}
}

//Interface in Domain module of application module (Also tried IRepository<ReferenceData, string> also tried adding ITransientDependency)
public interface IReferenceDataRepository : IBasicRepository<ReferenceData, string>

// Dependency injection in AppService of application module
public ReferenceDataAppService(IReferenceDataRepository referenceDataRepository)

In other modules in the project this works fine, these modules have been upgraded from version 6.0.5 to 7.0.3. The module with the problem is added to the application as a new v7.0.3 module.

I do not use: SkipAutoServiceRegistration

Documentation says: Some specific types are registered to dependency injection by default. Examples:

Repositories (implement BasicRepositoryBase class or its subclasses) are registered as transient.

I've found the problem and solved it, thanks.

  • ABP Framework version: v7.0.3

  • UI type: MVC

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes / no

  • Exception message and stack trace:

  • Autofac.Core.DependencyResolutionException HResult=0x80131500 Message=An exception was thrown while activating Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionEndpointDataSourceFactory -> Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider -> λ:Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProvider[] -> Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider -> Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactory -> λ:Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProvider[] -> Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider -> Microsoft.Extensions.Options.UnnamedOptionsManager1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]] -> Microsoft.Extensions.Options.OptionsFactory1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]] -> λ:Microsoft.Extensions.Options.IConfigureOptions1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]][] -> Microsoft.Extensions.DependencyInjection.MvcDataAnnotationsMvcOptionsSetup -> Volo.Abp.Localization.AbpStringLocalizerFactory -> Volo.Abp.LanguageManagement.External.ExternalLocalizationStore. Source=Autofac StackTrace: at Autofac.Core.Resolving.Middleware.ActivatorErrorHandlingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.RegistrationPipelineInvokeMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.SharingMiddleware.<>c__DisplayClass5_0.<Execute>b__0() at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid id, Func1 creator) at Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance(Guid primaryId, Nullable1 qualifyingId, Func1 creator) at Autofac.Core.Resolving.Middleware.SharingMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Resolving.Middleware.CircularDependencyDetectorMiddleware.Execute(ResolveRequestContext context, Action1 next) at Autofac.Core.Resolving.Pipeline.ResolvePipelineBuilder.<>c__DisplayClass14_0.<BuildPipeline>b__1(ResolveRequestContext ctxt) at Autofac.Core.Pipeline.ResolvePipeline.Invoke(ResolveRequestContext ctxt) at Autofac.Core.Resolving.ResolveOperation.InvokePipeline(ResolveRequest request, DefaultResolveRequestContext requestContext) at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.ExecuteOperation(ResolveRequest request) at Autofac.Core.Resolving.ResolveOperation.Execute(ResolveRequest request) at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(ResolveRequest request) at Autofac.Core.Container.ResolveComponent(ResolveRequest request) at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType) at Autofac.Extensions.DependencyInjection.AutofacServiceProvider.GetRequiredService(Type serviceType) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllerRoute(IEndpointRouteBuilder endpoints, String name, String pattern, Object defaults, Object constraints, Object dataTokens) at Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule.<>c.<ConfigureServices>b__1_10(EndpointRouteBuilderContext endpointContext) at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.<>c__DisplayClass0_0.<UseConfiguredEndpoints>b__0(IEndpointRouteBuilder endpoints) at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action1 configure) at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.UseConfiguredEndpoints(IApplicationBuilder app, Action`1 additionalConfigurationAction) at Nico.Web.NicoWebModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\SERVER\Innoview\Projects\VS2022\Nico7\Application\src\Nico.Web\NicoWebModule.cs:line 605 at Volo.Abp.Modularity.AbpModule.OnApplicationInitializationAsync(ApplicationInitializationContext context) at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.

    This exception was originally thrown at this call stack: [External Code]

Inner Exception 1: DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Microsoft.Extensions.Options.IOptions`1[Volo.Abp.Localization.AbpLocalizationOptions], Volo.Abp.LanguageManagement.External.ILocalizationResourceRecordRepository, Volo.Abp.LanguageManagement.External.IExternalLocalizationStoreCache)' on type 'ExternalLocalizationStore'.

Inner Exception 2: MissingMethodException: Method not found: 'Volo.Abp.Localization.LocalizationResource Volo.Abp.Localization.LocalizationResourceExtensions.AddVirtualJson(Volo.Abp.Localization.LocalizationResource, System.String)'.

  • Steps to reproduce the issue:" Upgraded abp from version 6.0 to 7.0.3

In your documentation I can see that there were changes to the LocalizationResource and that it could be a breaking change. The application crashes on app.UseConfigureEndpoints() in my main webmodule. I did create a migration and updated the database after the update to abp version 7.0.3.

So it broke my application but I don't see what I need to do to resolve it, can you help? Kind Regards,

Patrick

Hi,

You guys said that the change underneath would be merged in abp 6.0.0 but I have upgraded my project to 6.0.0 and the property

EntityPropertyChangeInfo.MaxValueLength is still a const int instead of a static int

https://github.com/abpframework/abp/blob/745d374a5a433a12d45e2ef591e6c85265a785cb/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/EntityPropertyChangeInfo.cs#L18

As I have my entities marked as audited the changed properties should show up but the audit log and the database only show the action not the properties. So the problem is still there, we need to be able to rely on the audit log.

You can either log them manually or add to EntityHistorySelectors in AbpAuditingOptions.

@gterdem I have decorated the classes with [Audited] which should be the same as with the entityhistoryselectors isn't it?

Okay so I created my own audited scope

    using (var informationScope = auditingManager.BeginScope())
    {
        auditingManager.Current.Log.Url = "InformationWorker";
        auditingManager.Current.Log.UserName = "Hangfire";
        auditingManager.Current.Log.HttpStatusCode = 200;

        ..... get entities .....        
        ..... update entity .....
        ..... create entity .....
        
        await informationScope.SaveAsync(); 
    }       

Now this shows one action which is fine, then it shows the entity changes but only the insert has properties. The entitities that are updated don't show the changed properties, the entitychange is empty. Do I need to log them manually?

Showing 1 to 10 of 14 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11