Starts in:
2 DAYS
6 HRS
16 MIN
45 SEC
Starts in:
2 D
6 H
16 M
45 S

Activities of "Tony_Albutt"

  • ABP Framework version: upgraded from v6.0.3 to 7.4.2
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • **Tiered (for MVC) no
  • Exception message and full stack trace: None - no errors in the log files
  • Steps to reproduce the issue: Background jobs not been triggered after upgrading to version 7.4.2

Hi

When I upgraded form version 6.0.3 to 7.4.2, my background jobs are no longer been run None of the 20 ExecuteAsync methods are been triggered. I have 3 user modules with background Jobs. I removed the three modules to see if this may cause issues with the version 7 and 8 updates. This did not resolve any issues.

No log errors and no warnings logged.

This problem is on the development environment and the Live test server.

Has there been any changes, or encasements, for the default implementation for Background Jobs? None of my 20 background jobs are been run after the upgrade. The ExecuteAsync methods are never called.

From the database table AbpBackgroundJobs, none of the LastTryTime fields are populated,0 nor the TryCounts are updated.

JobName = RequerstToBook JobArgs = (Correct json data has been filled) TryCount =0 NextTryTime = correct data and time (earlier today) LastTryTime = NULL IsAbandoned = 0 Priority = 15

This one of my job arguments

    [BackgroundJobName("RequerstToBook")]
    public class RequestToBookArgs
    {
        public string TenantName { get; set; }
        public Guid TenantId { get; set; }
        public Guid UserId { get; set; }
        public string UserName { get; set; }
        public Guid TravelRequestId { get; set; }
        public Guid SupplierId { get; set; }
        public Guid SupplierContactId { get; set; }
        public Guid QuoteId { get; set; }
        public List<Guid> LineItems { get; set; }
        public string NoteToTMC { get; set; }
    }

and this is the background job

public class RequestToBookJob : AsyncBackgroundJob<RequestToBookArgs>, ITransientDependency
{
    private readonly IRequestForQuotesAppService _requestForQuotesAppService;
    private readonly IEmailSender _emailSender;
    private readonly ICurrentTenant _currentTenant;
    private readonly IMailBotAppService _mailBotAppService;

    public RequestToBookJob(
        IEmailSender emailSender,
        ICurrentTenant currentTenant,
        IMailBotAppService mailBotAppService,
        IRequestForQuotesAppService requestForQuotesAppService)
    {
        _emailSender = emailSender;
        _currentTenant = currentTenant;
        _mailBotAppService = mailBotAppService;
        _requestForQuotesAppService = requestForQuotesAppService;
    }

    public override async Task ExecuteAsync(RequestToBookArgs args)
    {
        var watch = new System.Diagnostics.Stopwatch();
        watch.Start();
        var Comment = await ProcessRequestToBookAsync(args);
        watch.Stop();
    }

    private async Task<string> ProcessRequestToBookAsync(RequestToBookArgs args)
    {
        var result = await _requestForQuotesAppService.GenerateRequestToBook(args);
        return result;
    }
}

I have now added a AbpBackgroundJobWorkerOptions to me ApplicationModule. this did not resolve the issue

            Configure<AbpBackgroundJobWorkerOptions>(options =>
            {
                options.DefaultTimeout = 3600; 
            });

in ApplicationNameTestBaseModule : AbpModule

    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpBackgroundJobOptions>(options =>
        {
            options.IsJobExecutionEnabled = false;
        });

        context.Services.AddAlwaysAllowAuthorization();
    }

I have now updated to version 8.0.2 to see if this fixes the issue, and still no change.

I then created a ne app and added one Background job for testing. BackgroundsJods run in this app.

I compared all library referenced and don't see ant differences between the two applications. Core and new code associated to background Jobs.

How can I see if the background service is querying the database?

How can I resolve this issue?

Thanks and regards Tony

  • ABP Framework version: v6.0.3 to 7.4.2
  • 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:
  • Steps to reproduce the issue:

I have updated my project from version 6.0.3 to 7.4.2 I used the "Update all ABP packages" option using ABP Suite

Once I got the application to compile and made the recommended migration changes, and add-migrations, I can now compile and run the application Two problems that I need to resolve, before I can see what else is broken.

  1. After the update, I can no longer use the ABP Suite to open the project to add new entities. The UI error is "An internal error occurred during your request!" From the Terminal window, this is the error response `PS C:\Users\antho> abp suite ABP CLI 7.4.2 Starting Suite v7.4.2 ... Opening http://localhost:3000 Press Ctrl+C to shut down. [09:52:54 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }

[09:52:54 ERR] Error converting value {null} to type 'System.Int32'. Path 'Properties[1].EnumValues.Delivery', line 61, position 24. Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.Int32'. Path 'Properties[1].EnumValues.Delivery', line 61, position 24. ---> System.InvalidCastException: Null object cannot be converted to a value type. at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateDictionary(IDictionary dictionary, JsonReader reader, JsonDictionaryContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonSerializer.Deserialize(TextReader reader, Type objectType) at Volo.Abp.Suite.Services.PersistanceService.VU1gjyYmMA(String ) at System.Linq.Enumerable.SelectIPartitionIterator2.MoveNext() at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable1 collection) at Volo.Abp.Suite.Services.PersistanceService.GetEntitiesAsync(Guid solutionId) at Volo.Abp.Suite.Controllers.CrudPageGeneratorController.GetEntitiesAsync(Guid solutionId) at lambda_method1814(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.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  1. The Data Tables do not render correctly.

Note: I have the LeptonX as a module in the project. When I remove it, and reference Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX" Version="2.4.-" then the DataTable works again. I will have to move all my code changes, until ABP suite works again

What can I do to get my application and ABP Suite working again.

Thanks and regards Tony

  • ABP Framework version: v5.3.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: Setting value for 'Abp.Mailing.Smtp.Host' is null or empty!
  • Steps to reproduce the issue:"

Hi

I have run into a small problem when sending SMTP emails from a background job.

I have created a Email reader background job, that is scheduled to process the inbox emails for the tenants IMAP settings using MailKit. This is working well.

One of the functions is for me to send emails, with the attachments.

The only way to do so using Volo.Abp.Emailing, is to use the mailMessage

await _emailSender.SendAsync(mailMessage, true);

For emails without attachments, to use the tenants SMTP email credentials, I need to change the currentTenant

This works for emails, without attachments

                using (_currentTenant.Change(args.TenantId, args.TenantName))
                {
                    await _emailSender.SendAsync(
                        args.EmailAddress,
                        args.Subject,
                        args.Body,
                        args.IsHtml
                    );
                }

However, this does not work when using mailMessage, as suggested in your documentation.

using (_currentTenant.Change(args.TenantId, args.TenantName))
{
	await _emailSender.SendAsync(mailMessage, true)
}

This throws an error

-		$exception	{"Setting value for 'Abp.Mailing.Smtp.Host' is null or empty!"}	Volo.Abp.AbpException
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
+		InnerException	null	System.Exception
		Source	"Volo.Abp.Emailing"	string
		
		StackTrace	
		   at Volo.Abp.Emailing.EmailSenderConfiguration.<GetNotEmptySettingValueAsync>d__6.MoveNext()
		   at Volo.Abp.Emailing.Smtp.SmtpEmailSender.<BuildClientAsync>d__4.MoveNext()
		   at Volo.Abp.Emailing.Smtp.SmtpEmailSender.<SendEmailAsync>d__5.MoveNext()
		   at Volo.Abp.Emailing.EmailSenderBase.<SendAsync>d__9.MoveNext()
		   at ITX.MailBot.MailBotAppService.<ForwardEmailWithAttachments>d__41.MoveNext() in 
		   C:\Users\antho\source\repos\ITX_New\aspnet-core\src\ITX.Application\MailBot\MailBotAppService.cs:line 412

+		TargetSite	{Void MoveNext()}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

When I remove the _currentTenant.Change(args.TenantId, args.TenantName code, so that I use the default credentials, I get a different error

-		$exception	{"Failure sending mail."}	System.Net.Mail.SmtpException
+		InnerException	{"Cannot access a closed file."}	System.Exception {System.ObjectDisposedException}
		Message	"Failure sending mail."	string
		Source	"Volo.Abp.Emailing"	string
		StackTrace	   
			at Volo.Abp.Emailing.Smtp.SmtpEmailSender.<SendEmailAsync>d__5.MoveNext()
			at Volo.Abp.Emailing.EmailSenderBase.<SendAsync>d__9.MoveNext()
			at ITX.MailBot.MailBotAppService.<ForwardEmailWithAttachments>d__41.MoveNext() 
			in C:\Users\antho\source\repos\ITX_New\aspnet-core\src\ITX.Application\MailBot\MailBotAppService.cs:line 412
+		TargetSite	{Void MoveNext()}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

This is my code for forward the email

        private async Task<bool> ForwardEmailWithAttachments(MimeMessage email, string emailAddress, InboxArgs args)
        {
            var message = email;
            var mailMessage = new MailMessage(
                FromEmailAddress,
                emailAddress,
                "FWD: " + email.Subject,
                 email.HtmlBody
                );

            if (email.Attachments.Any())
            {
                foreach (var mailAttachment in message.Attachments)
                {
                    string fileName = mailAttachment.ContentDisposition?.FileName ?? mailAttachment.ContentType.Name;
                    string FileType = Path.GetExtension(fileName);
                    string contentType = "application/" + FileType;
                    var part = (MimePart)mailAttachment;
                    using var stream = System.IO.File.Create(fileName);
                    part.Content.DecodeTo(stream);
                    stream.Position = 0;
                    mailMessage.Attachments.Add(new System.Net.Mail.Attachment(stream, fileName, contentType));
                }
                using (_currentTenant.Change(args.TenantId, args.TenantName))
                {
                    //TODO : TA : 2022-08-24 : The code below throws an error
                    await _emailSender.SendAsync(mailMessage, true);
                }
            }
            return true;
        }

I don't want to change the default SMTP yet and use my own.

Are you able to help?

Thanks and regards Tony

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

I have updated my solution from version 5.1.4 to version 5.3.0

I have made too many changes and commits to roll back to version 5.2

The application runs in the development environment, but reports an error when deployed.

This is the line that throws the error

await app.InitializeApplicationAsync();

This is line 38 in ITX.Web\Program.cs

What can I do the fix this Regards Tony

This is from the log file

2022-06-22 09:40:02.562 +02:00 [INF] Starting IdentityServer4 version 4.1.2+997a6cdd643e46cd5762b710c4ddc43574cbec2e
2022-06-22 09:40:05.038 +02:00 [WRN] Savepoints are disabled because Multiple Active Result Sets (MARS) is enabled. If 'SaveChanges' fails, then the transaction cannot be automatically rolled back to a known clean state. Instead, the transaction should be rolled back by the application before retrying 'SaveChanges'. See https://go.microsoft.com/fwlink/?linkid=2149338 for more information. To identify the code which triggers this warning, call 'ConfigureWarnings(w => w.Throw(SqlServerEventId.SavepointsDisabledBecauseOfMARS))'.
2022-06-22 09:40:05.179 +02:00 [INF] Using the default authentication scheme Identity.Application for IdentityServer
2022-06-22 09:40:05.349 +02:00 [WRN] Using an in-memory repository. Keys will not be persisted to storage.
2022-06-22 09:40:05.349 +02:00 [WRN] Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.
2022-06-22 09:40:06.770 +02:00 [FTL] Host terminated unexpectedly!
Volo.Abp.AbpInitializationException: An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module ITX.Web.ITXWebModule, ITX.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: The type 'qgApoZ2OmDdJqiAoXp5.L4ObZ82mStp54vqoB0A' is not a valid page. A page must define a public, non-static 'Model' property.. See the inner exception for details.
 ---> System.InvalidOperationException: The type 'qgApoZ2OmDdJqiAoXp5.L4ObZ82mStp54vqoB0A' is not a valid page. A page must define a public, non-static 'Model' property.
   at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultPageApplicationModelProvider.CreateModel(PageActionDescriptor actionDescriptor, TypeInfo pageTypeInfo)
   at Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultPageApplicationModelProvider.OnProvidersExecuting(PageApplicationModelProviderContext context)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.CompiledPageActionDescriptorFactory.CreateCompiledDescriptor(PageActionDescriptor actionDescriptor, CompiledViewDescriptor viewDescriptor)
   at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.CompiledPageActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
   at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
   at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.<>c__DisplayClass11_0.<Subscribe>b__0()
   at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
   at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
   at Microsoft.AspNetCore.Mvc.Routing.ControllerActionEndpointDataSource..ctor(ControllerActionEndpointDataSourceIdProvider dataSourceIdProvider, IActionDescriptorCollectionProvider actions, ActionEndpointFactory endpointFactory, OrderedEndpointsSequenceProvider orderSequence)
   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.&lt;&gt;c.&lt;ConfigureServices&gt;b__1_10(EndpointRouteBuilderContext endpointContext)
   at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.&lt;&gt;c__DisplayClass0_0.&lt;UseConfiguredEndpoints&gt;b__0(IEndpointRouteBuilder endpoints)
   at Microsoft.AspNetCore.Builder.EndpointRoutingApplicationBuilderExtensions.UseEndpoints(IApplicationBuilder builder, Action`1 configure)
   at Microsoft.AspNetCore.Builder.AbpAspNetCoreApplicationBuilderExtensions.UseConfiguredEndpoints(IApplicationBuilder app, Action`1 additionalConfigurationAction)
   at ITX.Web.ITXWebModule.OnApplicationInitialization(ApplicationInitializationContext context) in C:\Users\antho\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Web\ITXWebModule.cs:line 456
   at Volo.Abp.Modularity.AbpModule.OnApplicationInitializationAsync(ApplicationInitializationContext context)
   at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.InitializeAsync(ApplicationInitializationContext context, IAbpModule module)
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   --- End of inner exception stack trace ---
   at Volo.Abp.Modularity.ModuleManager.InitializeModulesAsync(ApplicationInitializationContext context)
   at Volo.Abp.AbpApplicationBase.InitializeModulesAsync()
   at Volo.Abp.AbpApplicationWithExternalServiceProvider.InitializeAsync(IServiceProvider serviceProvider)
   at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplicationAsync(IApplicationBuilder app)
   at ITX.Web.Program.Main(String[] args) in C:\Users\antho\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Web\Program.cs:line 38
  • ABP Framework version: v4.4.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: Can't compile, see two types of errors below
  • Steps to reproduce the issue:" Upgrade from version 4.4.0 to 5.14

I have been having problems upgrading to version 5.x from 4.4 for some time now... I want to view some source code in the demo, to verify that you have not introduced some breaking changes Please enable access to my account to view source code of samples.

I am getting the following two types of errors in 350+ places after updating. to version 5.1.4 and dot net core 6

All was working before version 5.x

Sample IQueryable error
CODE:

        private int GetNextLineNumber(Guid TravelRequestId)
        {
            var LastLine = _expenseItemRepository.Where(p => p.TravelRequestId == TravelRequestId).Max(p => (int?)p.Line);
            return LastLine == null ? 1 : (int)LastLine + 1;
        }

Error: Severity Code Description Project File Line Suppression State Error CS1929 'IExpenseItemRepository' does not contain a definition for 'Where' and the best extension method overload 'DynamicQueryableExtensions.Where(IQueryable, string, params object[])' requires a receiver of type 'IQueryable' ITX.Application C:\Users\Anthony\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Application\ExpenseItems\ExpenseItemAppService.cs 228 Active

Sample IEnumerable error - CODE:

        public virtual async Task<PagedResultDto<LookupDto<Guid>>> GetEmployeeLookupAsync(LookupRequestDto input)
        {
            var query = _employeeRepository.AsQueryable()
                .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                    x => x.FullName != null &&
                         x.FullName.Contains(input.Filter));
            var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync<Employee>();
            var totalCount = query.Count();
            return new PagedResultDto<LookupDto<Guid>>
            {
                TotalCount = totalCount,
                Items = ObjectMapper.Map<List<Employee>, List<LookupDto<Guid>>>(lookupData)
            };
        }

Severity Code Description Project File Line Suppression State Error CS1929 'IRepository<Employee, Guid>' does not contain a definition for 'AsQueryable' and the best extension method overload 'Queryable.AsQueryable(IEnumerable)' requires a receiver of type 'IEnumerable' ITX.Application C:\Users\Anthony\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Application\ExpenseItems\ExpenseItemAppService.cs 169 Active

I have made 1800+ changes to my code to fix the breaking changes as below e.g. var queryable = await _employeeRepository.GetQueryableAsync();

        public virtual async Task<PagedResultDto<LookupDto<Guid>>> GetEmployeeLookupAsync(LookupRequestDto input)
        {
            IQueryable<Employee> queryable = await _employeeRepository.GetQueryableAsync();
            var query = queryable
                .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                    x => x.FullName != null &&
                         x.FullName.Contains(input.Filter));
            var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync<Employee>();
            var totalCount = query.Count();
            return new PagedResultDto<LookupDto<Guid>>
            {
                TotalCount = totalCount,
                Items = ObjectMapper.Map<List<Employee>, List<LookupDto<Guid>>>(lookupData)
            };
        }

The application now compiles, but does not run

I re-added the Account and the Lepton Theme modules. This did not work as the ABP Suite application added a Angular folder with the two modules.

I am getting the below error when running the application

[17:17:51 INF] Starting web host. [17:17:52 FTL] Host terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during ConfigureServices phase of the module Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule, Volo.Abp.AspNetCore.Mvc, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Could not load type 'Volo.Abp.Identity.ProfileDto' from assembly 'Volo.Abp.Identity.Pro.Application.Contracts, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'. Could not load type 'Volo.Abp.Identity.ProfileDto' from assembly 'Volo.Abp.Identity.Pro.Application.Contracts, Version=5.1.4.0, Culture=neutral, PublicKeyToken=null'.

More info on error

Exception thrown: 'System.Reflection.ReflectionTypeLoadException' in System.Private.CoreLib.dll Exception thrown: 'Volo.Abp.AbpInitializationException' in Volo.Abp.Core.dll 'ITX.Web.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.2\System.Reflection.Metadata.dll'. The thread 0x6964 has exited with code 0 (0x0). The thread 0x5790 has exited with code 0 (0x0). The program '[33564] ITX.Web.exe' has exited with code 1 (0x1).

Are you able to help?

Thanks and regards Tony

I want to have a user called System-Notifications. I want to use the Chat module to display notifications to users, and will contain a link to a task that they need to perform. What is the recommended method to use, so that I can send Chat notifications to users from within a Background Job?

Below, I have tested the conversationAppService.SendMessageAsync , and works from a web page calling an AppService method This does not work when I impersonate a user. How would I correct this?

I am unable to send a chat message using conversationAppService.SendMessageAsync when impersonating a user : using (_currentPrincipalAccessor.Change(newPrincipal)) I get an exception "Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown" when impersonating, although the impersonated CurrentUser.IsAuthenticated == true

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.4.4
  • UI type: **MVC **
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. **** below for the stack trace
  • Steps to reproduce the issue: This code rases the exception.
  • using (_currentPrincipalAccessor.Change(newPrincipal)) { var userName = CurrentUser.UserName; //See below **ii for contents await _conversationAppService.SendMessageAsync( // This is where the exception is triggered new SendMessageInput { TargetUserId = targetUserId, Message = args.Message, } ); }
  • * See below for the full code.

The purpose of the code is so that I can use the Chat module for In-App Notifications from a BackgroundJob

When I test from a web page calling an AppService, I can send the message as a logged in user using CurrentUser When I impersonate using currentPrincipalAccessor , I get an Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown.

* See below for my code.

    public async Task SendNotify(NotifyArgs args)
    {
        try
        {

            Guid.TryParse("54e53b63-14be-4e22-5a0b-39fe42671983", out var targetUserId);
            Guid.TryParse("5e328781-65e6-5d29-e83d-39fe195a5a22", out var senderUserId);

            //// Sends a SignalR message, does not save to DB, but works if the user is looking at the page
            //var chatMessage = new ChatMessageRdto()
            //{
            //    SenderUserId = senderUserId,
            //    SenderUsername = "user1@mail.com",
            //    SenderName = "User",
            //    SenderSurname = "One",
            //    Text = args.Message
            //};
            //await _realTimeChatMessageSender.SendAsync(targetUserId, chatMessage);

            //Sends a message and saves to DB
            var realUser = CurrentUser; //See below ** for content of CurrentUser
            var realUserName = CurrentUser.UserName; //returns "john"
            await _conversationAppService.SendMessageAsync(
               new SendMessageInput
               {
                   TargetUserId = targetUserId,
                   Message = args.Message,
               }
            );

            var newPrincipal = new ClaimsPrincipal(
                                    new ClaimsIdentity(
                                        new Claim[]
                                        {
                                                new Claim(AbpClaimTypes.TenantId, CurrentUser.TenantId.ToString()),
                                                new Claim(AbpClaimTypes.UserId, CurrentUser.Id.ToString()),
                                                new Claim(AbpClaimTypes.ImpersonatorTenantId, CurrentUser.TenantId.ToString()),
                                                new Claim(AbpClaimTypes.ImpersonatorUserId, "3e1c2476-ad49-85c7-9101-39fe18cffd26"),
                                                new Claim(AbpClaimTypes.Email, "user1@mail.com"),
                                                new Claim(AbpClaimTypes.UserName, "user1@mail.com"),
                                                new Claim(AbpClaimTypes.Name, "User"),
                                                new Claim(AbpClaimTypes.SurName, "One"),
                                                new Claim(AbpClaimTypes.Role, "Traveller")
                                        }
                                    )
                                );

            using (_currentPrincipalAccessor.Change(newPrincipal))
            {
                var userName = CurrentUser.UserName; //See below *** for content of CurrentUser
                await _conversationAppService.SendMessageAsync( // This is where the exception is triggered
                   new SendMessageInput
                   {
                       TargetUserId = targetUserId,
                       Message = args.Message,
                   }
               );
            }

        }
        catch (Exception ex)
        {
            //throw;
        }

    }

** realUser = CurrentUser

*** CurrentUser = newPrincipal

**** Exception message and stack trace

  • ABP Framework version: v4.3.3

  • UI type: MVCr

  • DB provider: EF CoreB

  • Tiered (MVC): yes

  • Exception message and stack trace:

  • Returned 500 error

  • Below is from the loge file.

  • 2021-08-03 15:05:09.606 +02:00 [INF] Executed page /TravelRequests/Details in 1867.9162ms 2021-08-03 15:05:09.606 +02:00 [INF] Executed endpoint '/TravelRequests/Details' 2021-08-03 15:05:09.607 +02:00 [ERR] An unhandled exception has occurred while executing the request. System.InvalidOperationException: The view 'Components/TravelCostsWidget/Default' was not found. The following locations were searched: /Pages/TravelRequests/Components/TravelCostsWidget/Default.en.cshtml /Pages/TravelRequests/Components/TravelCostsWidget/Default.cshtml /Pages/Components/TravelCostsWidget/Default.en.cshtml /Pages/Components/TravelCostsWidget/Default.cshtml /Pages/Shared/Components/TravelCostsWidget/Default.en.cshtml /Pages/Shared/Components/TravelCostsWidget/Default.cshtml /Views/Shared/Components/TravelCostsWidget/Default.en.cshtml /Views/Shared/Components/TravelCostsWidget/Default.cshtml at Microsoft.AspNetCore.Mvc.ViewEngines.ViewEngineResult.EnsureSuccessful(IEnumerable1 originalLocations) at Microsoft.AspNetCore.Mvc.ViewComponents.ViewViewComponentResult.ExecuteAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker.InvokeAsync(ViewComponentContext context) at Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper.InvokeCoreAsync(ViewComponentDescriptor descriptor, Object arguments) at Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpViewComponentHelper.InvokeWidgetAsync(Object arguments, WidgetDefinition widget) at Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpViewComponentHelper.InvokeAsync(String name, Object arguments) at AspNetCore.Pages_TravelRequests_Details.<ExecuteAsync>b__94_132() in C:\Users\Anthony\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Web\Pages\TravelRequests\Details.cshtml:line 444 at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder) at Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab.AbpTabTagHelperService.ProcessAsync(TagHelperContext context, TagHelperOutput output) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count) at AspNetCore.Pages_TravelRequests_Details.<ExecuteAsync>b__94_51() at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder) at Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab.AbpTabDropdownTagHelperService.ProcessAsync(TagHelperContext context, TagHelperOutput output) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count) at AspNetCore.Pages_TravelRequests_Details.<ExecuteAsync>b__94_45() at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.GetChildContentAsync(Boolean useCachedResult, HtmlEncoder encoder) at Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab.AbpTabsTagHelperService.ProcessAsync(TagHelperContext context, TagHelperOutput output) at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, Int32 i, Int32 count) at AspNetCore.Pages_TravelRequests_Details.<ExecuteAsync>b__94_3() at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() at AspNetCore.Pages_TravelRequests_Details.ExecuteAsync() in C:\Users\Anthony\source\repos\ITX_New\ITX\aspnet-core\src\ITX.Web\Pages\TravelRequests\Details.cshtml:line 22 at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts) at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|29_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeResultFilters>g__Awaited|27_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService) at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpJwtTokenMiddlewareExtension.<>c__DisplayClass0_0.<<UseJwtTokenMiddleware>b__0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task) 2021-08-03 15:05:09.616 +02:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController.Index (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared)' 2021-08-03 15:05:09.616 +02:00 [INF] Route matched with {action = "Index", controller = "Error", area = "", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Microsoft.AspNetCore.Mvc.IActionResult] Index(Int32) on controller Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Controllers.ErrorController (Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared). 2021-08-03 15:05:09.617 +02:00 [INF] Executing ViewResult, running view ~/Views/Error/500.cshtml. 2021-08-03 15:05:09.628 +02:00 [INF] Bundling __bundles/A28A764CBD2BA2A0A12B2E84D0BBCF6E.0C4EDBE702C62503400CDB0114F9D00A.css (2 files) 2021-08-03 15:05:09.635 +02:00 [INF] > Minified /Pages/Shared/Components/css/Default.css (10010 bytes -> 6559 bytes) 2021-08-03 15:05:09.639 +02:00 [INF] > Minified /Pages/Shared/Components/TravelCostsWidget/Default.css (799 bytes -> 470 bytes) 2021-08-03 15:05:09.639 +02:00 [INF] Bundled __bundles/A28A764CBD2BA2A0A12B2E84D0BBCF6E.0C4EDBE702C62503400CDB0114F9D00A.css (7029 bytes)

  • Steps to reproduce the issue:"

  • Create a widget and add it to a details page.

  • Works in debug mode

  • Does not work when deployed to local IIS server not a hosted server.

  • Code to follow

  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace: the main page is replaced by the Modal page
  • Steps to reproduce the issue:" I can get the apb-paginator working on a main form when clicking page 2, as the main form is reloades with page 2 data. That is, with all menues, headers etc as expected. How do I get the abp-paginator to work with a Modal popup form?

What I want is, the details page to display : https://localhost:44334/TravelRequests/c9781b2c-b345-7c66-fe24-39fda1c7b387 I click a button to load a modal search form with the first 10 results that I get from an external api call. The Modal popup loads and displays page 1 correctly. DetailsWithModalPage1.png When I click page 2, the browser loads the modal form as the mail page and then this is no longer a modal form. That is, there is no menu anymore, the original details page is no longer loaded FaultyPage2.png!

Alternately, If I replace the Modal popup with a search page as a main page, how do I redirect to https://localhost:44334/TravelRequests/c9781b2c-b345-7c66-fe24-39fda1c7b387 after OnPostAsync() has been processed? if I use return RedirectToPage("/TravelRequests/" + TravelRequestId.ToString());, the browser gets the request, but does not display the page. In the browser debug tools, I can preview the page, but the browser does not display the page. What is the preferred redirect method that works with the ABP.IO Framework?

Thanks and regards Tony

Hi

I am unable to implement CI\CD as I am unable to compile on Azure DevOps, and therefore unable to deploy to Azure.

During the NuGetCommand process, I get an error with every Volo.Abp package ? ##[error]Packages failed to restore many lines like below NU1101: Unable to find package Volo.Abp.AspNetCore.Mvc.UI.Theme.Commercial. No packages exist with this id in source(s): NuGetOrg NU1101: Unable to find package Volo.Abp.Commercial.Core. No packages exist with this id in source(s): NuGetOrg NU1101: Unable to find package Volo.Abp.Identity.Pro.Application.Contracts. No packages exist with this id in source(s): NuGetOrg)

Do you have documentation for the build pipeline that is able to help, or assist me to get this resolved?

I have saved the log file. Screenshot below.

Showing 1 to 9 of 9 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06