Activities of "MichelZ"

Nevermind.... this was actually a deployment issue. The latest version didn't deploy properly, that's why I wasn't able to see the menu items :)

Looks like this is working now!

  • ABP Framework version: v5.1.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

We have upgraded to 5.1.1 and one of the features we're interested in is Impersonation. This worked well in aspnetzero for us. We have added the "Impersonation" Claim Type to the _App application.

However, we can't see any sign of Impersonation in the Angular UI. There are no permissions to set, there are no impersonation options.

We have looked at the documentation here: https://docs.abp.io/en/commercial/latest/modules/account/impersonation#angular

The documentation is fairly thin, some more description on HOW to impersonate users would also be great.

We found some of the 5.1.2 packages has some directory separator problem and we'll fix it very soon.

Interesting. We do see issues as well currently involving some of these packages, but our MO is a bit different. We get

@MichelZ, I am guessing you are using mac. Seems like the same problem with different error message.

We are using docker, so it's linux. But yes, seems like the same problem.

Interesting. We do see issues as well currently involving some of these packages, but our MO is a bit different. We get

#131 15.06 /usr/share/dotnet/sdk/6.0.101/Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3106: Assembly strong name "/root/.nuget/packages/volo.abp.commercial.core/5.1.2/lib/netstandard2.0/Volo.Abp.Commercial.Core.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [/src/src/company.product.Domain.Shared/company.product.Domain.Shared.csproj]

however it might as well be because the packages can't be downloaded properly...

We are experiencing the docker issue, too.

Answer

We get the same issue. Additionally we see a few of these errors:

#37 145.3 /usr/share/dotnet/sdk/6.0.101/Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3106: Assembly strong name "/root/.nuget/packages/volo.abp.commercial.core/5.1.2/lib/netstandard2.0/Volo.Abp.Commercial.Core.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [/src/src/company.product.Domain.Shared/company.product.Domain.Shared.csproj]

We also might start tweeting them...

https://twitter.com/abpcommercial https://twitter.com/volosoftcompany https://twitter.com/hibrahimkalkan

It's urgent.

Same here

Question

Hi

Using abp 4.4 with EF/SQL Server.

We don't like using "Id" as the column name for our entities, so we are using this workaround: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/586#issuecomment-135599562

It does work fine for entities that don't have a Guid Key. Once the Key is Guid, things start to break down. EF throws errors that the "Id column was not found".

We have found the cause of it, it's AbpDbContext.TrySetGuidId and AbpDbContext.ConfigureValueGenerated

We have also found a suitable workaround by overriding these functions like this:

protected override void TrySetGuidId(EntityEntry entry, IEntity<Guid> entity)
        {
            if (entry.Metadata.FindProperty("Id") == null)
            {
                // Ignore this, it's because we have removed the Id property.
                return;
            }

            base.TrySetGuidId(entry, entity);
        }

        protected override void ConfigureValueGenerated<TEntity>(ModelBuilder modelBuilder, IMutableEntityType mutableEntityType)
            where TEntity : class
        {
            if (!typeof(IEntity<Guid>).IsAssignableFrom(typeof(TEntity)))
            {
                return;
            }

            // Ignore if Id has NotMapped attribute
            var type = mutableEntityType.ClrType;
            var propertyInfo = type.GetProperty("Id", BindingFlags.DeclaredOnly |
                                                      BindingFlags.Public |
                                                      BindingFlags.Instance);

            if (propertyInfo != null)
            {
                var attribute = propertyInfo.GetCustomAttribute(typeof(NotMappedAttribute));
                if (attribute != null)
                {
                    return;
                }
            }

            base.ConfigureValueGenerated<TEntity>(modelBuilder, mutableEntityType);
        }

The configureValueGenerated function does create the property when it does not exist. So even when it was excluded with [NotMapped], this line from AbpDbContext adds it: var idPropertyBuilder = modelBuilder.Entity().Property(x => ((IEntity)x).Id);

(Note the documentation saying that "Returns an object that ban be used to configure a property of the entity type. If the specified property is not already part of the model, it will be added.")

So the Id property is added to the model if the type is Guid.

Then the TrySetGuidId also expects the Id property to be there: var idProperty = entry.Property("Id").Metadata.PropertyInfo;

Which of course fails, too.

Now to the question:

  • Is this the right way to handle this situation, or do you see a better way?
  • Are there some improvements for ABP that you can do to better support this scenario?

Thanks Michel

Hi @ismcagdas

I have mostly switched away from a docker-based local workflow that needs frequent downloading of packages, so I can't really say for sure. Might try again in the future, but good to know that improvements were made, thank you!

Thanks

Showing 11 to 20 of 40 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13