Activities of "zhongfang"

Yes, I call InsertAsync in try catch.

I must InsertAsnyc first, then continue with throw exception.

How to do?

After I upgrade to the 5.1.3. It is OK, now.

  • ABP Framework version: v5.1.3
  • UI type: Blazor (Server Side)
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: no exception. and I can find the success in Serilog out put.
  • Steps to reproduce the issue:"
  • Insert into repository by code
Serilog.Log.Information("开始登记取消关注的情况。Open Id:" + openId);
            ISubscribeUserRepository subscribeUserRepository = this.LazyServiceProvider.LazyGetRequiredService<ISubscribeUserRepository>();

            if (subscribeUserRepository == null)
            {
                throw new Exception("没有找到 ISubscribeUserRepository。");
            }

            SubscribeUser subscribeUser = (await subscribeUserRepository.GetQueryableAsync()).FirstOrDefault(p => p.OpenId == openId && p.TenantId == tenantId);

            if (subscribeUser == null)
            {
                subscribeUser = new SubscribeUser()
                {
                    OpenId = openId,
                    Nick = "unknown",
                    UnSubscribedOn = DateTime.Now,
                    SubscribedTimes = 1,
                    UnSubscribedTimes = 1,
                    WeChatAppId = this.CurrentWeChatApp.WeChatApp.Result.Id,
                    TenantId = tenantId
                };

                subscribeUser = await subscribeUserRepository.InsertAsync(subscribeUser, autoSave: true);
                Serilog.Log.Information("成功新增了取消关注的情况。Open Id:" + openId + ",创建时间:" + subscribeUser.CreationTime + "TenantId:" + tenantId);
            }
            else
            {
                subscribeUser.UnSubscribedOn = DateTime.Now;
                subscribeUser.UnSubscribedTimes = subscribeUser.UnSubscribedTimes + 1;

                await subscribeUserRepository.UpdateAsync(subscribeUser, autoSave: true);
                Serilog.Log.Information("成功更新了取消关注的情况。Open Id:" + openId);
            }

            return true;
  • In Serilog output, above operation of InsertAsync is success.
[23:11:16 INF] 开始登记取消关注的情况。Open Id:oZKzr0_vqPUa5e_DpS5gusyU7MGI
[23:11:16 DBG] Added 0 entity changes to the current audit log
[23:11:16 INF] 成功新增了取消关注的情况。Open Id:oZKzr0_vqPUa5e_DpS5gusyU7MGI,创建时间:2022/2/8 下午11:11:16TenantId:55eea838-1079-84e1-a90a-39fe122f8fb5
[23:11:16 DBG] Added 0 entity changes to the current audit log
  • but I can not find the data in database which should has been insert async successfully.
  • ABP Framework version: v5.1.1
  • UI type: Blazor (Server Side)
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no, It is a module application.
  • Exception message and stack trace:
  • Steps to reproduce the issue:"
  • Create a new Entity
  • Input many simple fields
  • Click ' Save and Generate;
  • Then , I will get exception as below. ( At commond line which start the ABP Suite)
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'startIndex')
   at System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex, Int32 count, CompareOptions options)
   at System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)
   at System.String.IndexOf(String value, Int32 startIndex, StringComparison comparisonType)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.F1AAu43krY(String  , String  , String  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.IBpAlr5Quy(String  , String  , Boolean  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.MYcAWPr5GZ(String  , String  , Boolean  , DatabaseProvider  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.yreAdjUhWH(String  , DatabaseProvider  )
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.cqSAJdEgpq()
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.EntityGenerateCommand.ExecuteAsync(CrudPageCommandOptions options)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.CommandManager.ExecuteAllAsync(CrudPageCommandOptions options)
   at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Commands.CrudPageGenerator.GenerateAsync(EntityModel entity, Solution solution)
   at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.SaveAndGenerateEntityAsync(Guid solutionId, EntityModel entity)
   at lambda_method2055(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfActionResultExecutor.Execute(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.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

I found many result articles by search Google and Baidu. And I tried out them. But I failed.

Now, you resolved my question.

Thank you.

Maybe you can add above content to UserGuide.

My clients want to look Chinese UI, while they touch my web application.

How to do ?

  • ABP Framework version: v5.1.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

In documents, you mentioned that

IHttpClientProxy接口

你可以像上面那样注入IBookAppService来使用客户端代理,也可以注入IHttpClientProxy<IBookAppService>获取更多明确的用法.这种情况下你可以使用IHttpClientProxy<T>接口的Service属性.

But I can't find IHttpClientProxy<T> in any nuget package.

It is working now. Tks!

If I open above url via browser, I got this error:

{"error":{"code":null,"message":"对不起,在处理你的请求期间,产生了一个服务器内部错误!","details":null,"data":{"ActivatorChain":"Volo.AbpIo.NuGet.Controllers.AbpIoNugetIndexController"},"validationErrors":null}}

/usr/share/dotnet/sdk/6.0.101/NuGet.targets(130,5): error : Unable to load the service index for source https://nuget.abp.io/d7db9f02-ecc5-486c-bcdf-*********/v3/index.json.

Showing 131 to 140 of 160 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13