Open Closed

Published Application: Could not load file or assembly 'System.Collections.Specialized' #3820


User avatar
0
alin.andersen created

Hey!

On our production environment (ubuntu) we have our published application (Release) deployed.

We get this error when opening the identity clients list in the web browser:

2022-10-06 09:58:40.194 +00:00 [INF] Executed endpoint 'Volo.Abp.IdentityServer.ApiResourcesController.GetAllListAsync (Volo.Abp.IdentityServer.HttpApi)'
2022-10-06 09:58:40.194 +00:00 [INF] Request finished HTTP/1.1 GET http://api2.test.lexica.ch/api/identity-server/api-resources/all?api-version=1.0 - - - 200 - application/json;+charset=utf-8 75.2246ms
2022-10-06 09:58:40.299 +00:00 [INF] Request starting HTTP/1.1 GET http://api2.test.lexica.ch/api/identity-server/clients?Sorting=&SkipCount=0&MaxResultCount=10&api-version=1.0 - -
2022-10-06 09:58:40.301 +00:00 [INF] Executing endpoint 'Volo.Abp.IdentityServer.ClientsController.GetListAsync (Volo.Abp.IdentityServer.HttpApi)'
2022-10-06 09:58:40.301 +00:00 [INF] Route matched with {controller = "Clients", area = "identityServer", action = "GetList", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.Application.Dtos.PagedResultDto`1[Volo.Abp.IdentityServer.Client.Dtos.ClientWithDetailsDto]] GetListAsync(Volo.Abp.IdentityServer.Client.Dtos.GetClientListInput) on controller Volo.Abp.IdentityServer.ClientsController (Volo.Abp.IdentityServer.HttpApi).
2022-10-06 09:58:40.305 +00:00 [ERR] ---------- RemoteServiceErrorInfo ----------
{
  "code": null,
  "message": "An internal error occurred during your request!",
  "details": null,
  "data": {},
  "validationErrors": null
}

2022-10-06 09:58:40.305 +00:00 [ERR] Could not load file or assembly 'System.Collections.Specialized, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

System.IO.FileNotFoundException: Could not load file or assembly 'System.Collections.Specialized, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

File name: 'System.Collections.Specialized, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.ComponentModel.TypeDescriptor.PipelineFilter(Int32 pipelineType, ICollection members, Object instance, IDictionary cache)
   at System.ComponentModel.TypeDescriptor.GetPropertiesImpl(Object component, Attribute[] attributes, Boolean noCustomTypeDesc, Boolean noAttributes)
   at Volo.Abp.Validation.DataAnnotationObjectValidationContributor.AddErrors(List`1 errors, Object validatingObject)
   at Volo.Abp.Validation.DataAnnotationObjectValidationContributor.ValidateObjectRecursively(List`1 errors, Object validatingObject, Int32 currentDepth)
   at Volo.Abp.Validation.DataAnnotationObjectValidationContributor.AddErrorsAsync(ObjectValidationContext context)
   at Volo.Abp.Validation.ObjectValidator.GetErrorsAsync(Object validatingObject, String name, Boolean allowNull)
   at Volo.Abp.Validation.MethodInvocationValidator.AddMethodParameterValidationErrorsAsync(IAbpValidationResult context, ParameterInfo parameterInfo, Object parameterValue)
   at Volo.Abp.Validation.MethodInvocationValidator.AddMethodParameterValidationErrorsAsync(MethodInvocationValidationContext context)
   at Volo.Abp.Validation.MethodInvocationValidator.ValidateAsync(MethodInvocationValidationContext context)
   at Volo.Abp.Validation.ValidationInterceptor.ValidateAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at lambda_method6744(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.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()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2022-10-06 09:58:40.308 +00:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
2022-10-06 09:58:40.308 +00:00 [INF] Executed action Volo.Abp.IdentityServer.ClientsController.GetListAsync (Volo.Abp.IdentityServer.HttpApi) in 6.1533ms
2022-10-06 09:58:40.308 +00:00 [INF] Executed endpoint 'Volo.Abp.IdentityServer.ClientsController.GetListAsync (Volo.Abp.IdentityServer.HttpApi)'

It seems we are missing this assembly 'System.Collections.Specialized'. I tried to publish the application again and in the output folder there is no 'System.Collections.Specialized' dll?

Any ideas?

  • ABP Framework version: v5.3.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered

Best Regards


6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    System.Collections.Specialized is part of NET core runtime.

    Can you try this?

    dotnet publish -c release --os linux --self-contained

  • User Avatar
    0
    alin.andersen created

    Perfect now its working!

    Before I tried to build it with Framework-Dependent (which is portable). Why does it not work if we build it in the portable way?

    Thanks!

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can check if the NET Core Runtime is installed on your server. https://learn.microsoft.com/en-us/dotnet/core/install/linux

  • User Avatar
    0
    alin.andersen created

    The runtime is installed and up-to-date:

    ubuntu@ov-e4ba07:~$ dotnet --info
    
    global.json file:
      Not found
    
    Host:
      Version:      6.0.9
      Architecture: x64
      Commit:       163a63591c
    
    .NET SDKs installed:
      No SDKs were found.
    
    .NET runtimes installed:
      Microsoft.AspNetCore.App 6.0.9 [/usr/lib/dotnet/dotnet6-6.0.109/shared/Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 6.0.9 [/usr/lib/dotnet/dotnet6-6.0.109/shared/Microsoft.NETCore.App]
    
    Download .NET:
      https://aka.ms/dotnet-download
    
    Learn about .NET Runtimes and SDKs:
      https://aka.ms/dotnet/runtimes-sdk-info
    
    

    So this is not the problem.

    Very strange that it is not working.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can you try to use CLI create a new project and deploy it to a new server(or virtual machine) to test again?

  • User Avatar
    0
    alin.andersen created

    Sorry unfortunately we do not have time to test this ourselves. I was just curious how this error might have happened.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11