Open Closed

Build successfully in VS2022, but failed in gitlab runner at linux server. #4133


User avatar
0
zhongfang created
  • ABP Framework version: v6.0.1
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
/src/modules/Yee.Change.Pay.Public/src/Yee.Change.Pay.Public.Domain.Shared/ChangePayPublicDomainSharedModule.cs(5,35): error CS0234: The type or namespace name 'Localization' does not exist in the namespace 'Volo.Abp.Validation' (are you missing an assembly reference?) [/src/modules/Yee.Change.Pay.Public/src/Yee.Change.Pay.Public.Domain.Shared/Yee.Change.Pay.Public.Domain.Shared.csproj]
  • Steps to reproduce the issue:"
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.Validation;
using global::Volo.Abp.Validation.Localization;
using Volo.Abp.VirtualFileSystem;
using Yee.Change.Account;
using Yee.Change.Common;
using Yee.Change.Config;
using Yee.Change.Pay.Public.Localization;
using Yee.Change.Rms;
using Yee.Change.Shop;

namespace Yee.Change.Pay.Public;

[DependsOn(
    typeof(AbpValidationModule)
)]
[DependsOn(
    typeof(ShopDomainSharedModule),
    typeof(RmsDomainSharedModule),
    typeof(AccountDomainSharedModule),
    typeof(ChangeConfigDomainSharedModule),
    typeof(CommonDomainSharedModule)
    )]
public class ChangePayPublicDomainSharedModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<AbpVirtualFileSystemOptions>(options =>
        {
            options.FileSets.AddEmbedded<ChangePayPublicDomainSharedModule>();
        });

        Configure<AbpLocalizationOptions>(options =>
        {
            options.Resources
                .Add<PayPublicResource>("en")
                .AddBaseTypes(typeof(AbpValidationResource))
                .AddVirtualJson("/Localization/PayPublic");
        });

        Configure<AbpExceptionLocalizationOptions>(options =>
        {
            options.MapCodeNamespace("PayPublic", typeof(PayPublicResource));
        });
    }
}

If i use 'using global::Volo.Abp.Validation.Localization;', I will get the same error.


8 Answer(s)
  • User Avatar
    0
    zhongfang created

    After I comment 2 lines within above.

    //using Volo.Abp.Validation.Localization;
    
            Configure<AbpLocalizationOptions>(options =>
            {
                options.Resources
                    .Add<WeChatPayResource>("en")
                    //.AddBaseTypes(typeof(AbpValidationResource))
                    .AddVirtualJson("/Localization/WeChatPay");
            });
    

    It build successfully in local windows machine with VS 2022. But will throw more exceptions within gitlab runner at linux server.

    /src/modules/Yee.Change.PointPay/src/Yee.Change.PointPay.Application.Contracts/Shared/LookupRequestDto.cs(11,30): error CS0103: The name 'MaxMaxResultCount' does not exist in the current context [/src/modules/Yee.Change.PointPay/src/Yee.Change.PointPay.Application.Contracts/Yee.Change.PointPay.Application.Contracts.csproj]
    /src/modules/Yee.Change.WeChatPay/src/Yee.Change.WeChatPay.Application.Contracts/Shared/LookupRequestDto.cs(11,30): error CS0103: The name 'MaxMaxResultCount' does not exist in the current context [/src/modules/Yee.Change.WeChatPay/src/Yee.Change.WeChatPay.Application.Contracts/Yee.Change.WeChatPay.Application.Contracts.csproj]
    /src/modules/Yee.Change.Pay.Public/src/Yee.Change.Pay.Public.HttpApi/PublicController.cs(6,42): error CS0246: The type or namespace name 'AbpControllerBase' could not be found (are you missing a using directive or an assembly reference?) [/src/modules/Yee.Change.Pay.Public/src/Yee.Change.Pay.Public.HttpApi/Yee.Change.Pay.Public.HttpApi.csproj]
      Yee.Change.Pay.Public.Domain -> /app/build/Yee.Change.Pay.Public.Domain.dll
    /src/src/Yee.Change.PayH5App.Domain.Shared/PayH5AppDomainSharedModule.cs(34,12): error CS0246: The type or namespace name 'AbpBackgroundJobsDomainSharedModule' could not be found (are you missing a using directive or an assembly reference?) [/src/src/Yee.Change.PayH5App.Domain.Shared/Yee.Change.PayH5App.Domain.Shared.csproj]
    /src/modules/Yee.Change.WeChatPay/src/Yee.Change.WeChatPay.Domain/WeChatPayments/WeChatPayment.cs(10,66): error CS0433: The type 'IMultiTenant' exists in both 'Volo.Abp.MultiTenancy.Abstractions, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' and 'Volo.Abp.MultiTenancy, Version=6.0.1.0, Culture=neutral, PublicKeyToken=null' [/src/modules/Yee.Change.WeChatPay/src/Yee.Change.WeChatPay.Domain/Yee.Change.WeChatPay.Domain.csproj]
    
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Is a new project created by CLI?

  • User Avatar
    0
    zhongfang created

    Very old project created by ABP suite. And upgrade from 5 to 6.0.0 to 6.0.1 Build successfully for several times even in local windows with VS 2022 and within gitlab runner at linux server.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I think the problem exists on gitlab runner at linux server.

  • User Avatar
    0
    zhongfang created

    But other module solutio can be build successfully within gitlab runner at linux server.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    How can we reproduce it?

  • User Avatar
    0
    zhongfang created

    I have found out the reason. There is a Directory.Build.props in root folder of a disk on Windows. But the Dockerfile is in sub folder. So, while run command dotnet build in Dockerfile, it can not use Directory.Build.props……

  • User Avatar
    0
    zhongfang created

    within the gitlab runner at linux. while calling docker build, it is also can not use the Directory.Build.props... so, all the propertiy value of version number is null...

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09