Troubleshooting — EricksonLopez.Auditing
Common integration issues when deploying EricksonLopez.Auditing (2.0.0) under strict .NET 10 (ImplicitUsings=disable, Nullable=enable) and Native AOT builds.
Missing EricksonLopez.Auditing.Abstractions Namespace
Section titled “Missing EricksonLopez.Auditing.Abstractions Namespace”- Symptom:
CS0234: The type or namespace name 'Abstractions' does not exist in the namespace 'EricksonLopez.Auditing'. - Cause: Even though the NuGet package is named
EricksonLopez.Auditing.Abstractions, its C# types (AuditRecord,IAuditStore,AuditQuery,TenantId) are declared innamespace EricksonLopez.Auditing;. - Fix: Import
using EricksonLopez.Auditing;instead ofusing EricksonLopez.Auditing.Abstractions;.
Blank TenantId or Unresolved AuditId / AuditScope
Section titled “Blank TenantId or Unresolved AuditId / AuditScope”- Blank
TenantId:new TenantId("")or whitespace throwsArgumentException(ArgumentException.ThrowIfNullOrWhiteSpace). Always validate tenant context upstream or passAuditContext.SystemTenantId(note: inv2.0.0,SystemTenantIdisstatic readonly, notconst). - Missing
AuditId/AuditScope: If you installed onlyEricksonLopez.Auditing.Abstractions, addEricksonLopez.Auditingto accessAuditId.NewId(),AuditScope, andHmacAuditIntegrityService. - Ambiguous
AuditRecordBuilder(CS0104): BothEricksonLopez.AuditingandEricksonLopez.Auditing.TestingdefineAuditRecordBuilder. If you import both namespaces, qualifyEricksonLopez.Auditing.AuditRecordBuilderor qualifyEricksonLopez.Auditing.Testing.InMemoryAuditStorewithout importing the testing namespace.
Native AOT and Package Availability Caveats
Section titled “Native AOT and Package Availability Caveats”- EF Core / MongoDB trimming errors:
EricksonLopez.Auditing.EntityFrameworkCoreandEricksonLopez.Auditing.MongoDbexplicitly setIsAotCompatible=falseandEnableTrimAnalyzer=false. UsePostgreSql,SqlServer,MySql,Oracle, orSqlitewhen targeting<PublishAot>true</PublishAot>. - Dapper reflection note:
EricksonLopez.Auditing.DapperinheritsIsAotCompatible=truein.csproj, butDirectory.Build.propsflags that underlying Dapperv2.1.79relies onReflection.Emitfor some mapping paths — test your exact queries under Native AOT before shipping. - Unpublished local satellites:
Analyzers,AzureKeyVault,Outbox, andSerilogare local3.1.0workspace projects with zero NuGet releases.