Open Closed

Migrate problem form version 4.4.0 to 5.1.4 #2736


User avatar
0
Tony_Albutt created
  • 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


5 Answer(s)
  • User Avatar
    0
    Tony_Albutt created

    This was one of the problems.

    Restored packages, added migrations and updated database as well.

    I am still having the same error.

  • User Avatar
    0
    Tony_Albutt created

    I found the Volo Account and Lepton modules in new location

    After replacing all files for account and implementing my changes, and replacing all Version="$(MicrosoftPackageVersion)" with correct version, I how get the application to run and the web browser to display the Lepton theme errors to display the bootstrap5 errors.

    Next step is to move lepton module file and re-implement my custom theme.

    Working again Custom themes are a bust. Will have to re-create them

  • User Avatar
    0
    Tony_Albutt created

    So many breaking changes, all over the place.

    I have been dreading updating to .net core 6 and ABP.IO version 5.x This is the third attempt. It took 4 days to move to .net core 5 and AMB.IO version 4.x Going to take a week to fix all the modal functionality that no longer works.

    **PLEASE **fix my access to the source code : The user "anthony.albutt@gmail.com" has no active ABP Commercial license!

    Have a good one. Regards Tony

  • User Avatar
    0
    alper created
    Support Team Director

    hi, the specified email address doesn't have an active license. maybe you are using the wrong email. may the following address belong to you? if so login with this account

    anthony@num***esign.co.za
    
  • User Avatar
    0
    Anthony_Albutt created

    Thanks, I can now access the source code with the other email address.

    I downloaded Bootstrap 5.0.2 and added the SCSS folder into the Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton application so that the SCSS cod generator does not fail for the references in the following file. Volo.Abp.AspNetCore.Mvc.UI.Theme.Lepton\Themes\Lepton\Global\styles\bootstrap\index.scss

    I had to exclude the following reference in the index.scss file, hope that I don't need this //@import "node_modules/bootstrap/scss/placeholders";

    The styles seem to be working.

    there were sone differences between bootstrap 4 and 5 which I think that I have sorted out.

    I am closing this ticket :)

    Thanks and regards Tony

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11