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.
[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.List
1.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.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask
1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
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
This is another one that is missing - from log files.
"message": "Cannot read the template Volo.Abp.Commercial.SuiteTemplates.Templates.Frontend.Mvc.Page.Partials.index.js.FilteringFields_Excel.txt"
"message": "Cannot read the template Volo.Abp.Commercial.SuiteTemplates.Templates.Server.AppService.Partials.AppService_ExcelMethodInterface.txt"
Not to warry
I have implemented my own
Have a good one
Regards Tony
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
What I found, is that they removed the Volo.CmsKit.Admin.Web.dll from the .web project.
I have tried to re-enable this code that I disabled, and you cant, as the package has been removed
If you create a new project, you will see that the code from this link has been removed. https://support.abp.io/QA/Questions/3301#answer-4c49fc06-f135-0eba-3291-3a04c6eacacf
I don't know if the rest if the CMS kit is working.
Regards Tony
I have been updating my app which was created using ABP suite since version 3.x There may be legacy code relating to CMS that needs to be updated in my project???
The current app does not run when deployed, but runs in debug mode.
To get the app to deploy, I need to disable CMS, probably just the Volo.CmsKit.Pro.Admin.Web which I have done as below.
The only way that I can deploy, is remove reference to the Volo.CmsKit.Pro.Admin.Web.dll in the solutions .web project
I am fortunate that I am not currently using the CMS, but now I can deploy.
I have got the application running with version 5.3.1 What I have done in addition to the steps above
from MenuContributor, a. remove using Volo.CmsKit.Pro.Admin.Web.Menus; b. remove context.Menu.SetSubItemOrder(CmsKitProAdminMenus.GroupName, 4);
I can now deploy to the live environment without issues.
**The problem file is Volo.CmsKit.Admin.Web.dll. ** When I re-enable code in file .\aspnet-core\src\project.Web\project.Web.csproj <PackageReference Include="Volo.CmsKit.Pro.Admin.Web" Version="5.3.1" /> ... from the projectMenuContributor : using Volo.CmsKit.Pro.Admin.Web.Menus; context.Menu.SetSubItemOrder(CmsKitProAdminMenus.GroupName, 4); ... from the projectWebModule.cs : using Volo.CmsKit.Pro.Admin.Web; typeof(CmsKitProAdminWebModule), Then the problem is back.
Sturla, I hope that you are not using the CMS public website
OK, still no luck
These are the steps that I followed
Uninstall ABP Suite
dotnet tool uninstall -g volo.abp.suite
Uninstall ABP CLI
dotnet tool uninstall -g volo.abp.cli
Install ABP CLI Version
dotnet tool install -g volo.abp.cli --version 5.3.1
Install ABP Suite version
abp suite install --version 5.3.1
Updated each module to version 5.3.1
Updated main application to version 5.3.1
Updated all projects from <TargetFramework>netstandard2.0</TargetFramework> to <TargetFramework>netstandard2.1</TargetFramework>
Updated all .Contracts projects and added <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> that required it
Updated all .Domain.Shared projects and added <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> that required it
updated all Microsoft.Extensions.FileProviders.Embedded pacages to Version="6.0.5"
updated all Package Reference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect packages to Version="6.0.5
Created new project with same application name and added Public.Web site. Deleted all files in my project for the public CMS website, and replaces with new files.
I am almost ok for now.
I found a local branch of my code using version 5.1.4 that I had not deleted yet. I have uninstalled the ABP cli and suite and installed 5.1.4 then upgraded to 5.2.2 I have re-implemented all me code changes from the 25 commits and have published to the live environment.
I will try some tests to remove the Public CMS website fixes to see what to do to get this working with 5.3.1
Hope that the root cause can be identifies soon.
Best of luck