Open Closed

Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object #7335


User avatar
0
drg_tverkroost created

Hi there,

I got this exception

"Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object". 

The same error occurred in the early version 5.3.0. Can somebody tell me how to fix that? ABP Framework version**: v8.1.3 UI Type**: Blazor Server Database System**: EF Core (SQL Server) Tiered (for MVC) Exception message and full stack trace**:

2024-06-12 10:59:32.885 +02:00 [ERR] Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e  (Parameter 'item')
System.ArgumentException: Given type (System.String&, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) should be instance of System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e  (Parameter 'item')
   at Volo.Abp.Collections.TypeList`1.CheckType(Type item)
   at Volo.Abp.Collections.TypeList`1.Add(Type item)
   at Volo.Abp.Http.Modeling.ApiTypeNameHelper.GetSimpleTypeName(Type type, ITypeList duplicateTypes)
   at Volo.Abp.Http.Modeling.ApiTypeNameHelper.GetSimpleTypeName(Type type)
   at Volo.Abp.Http.Modeling.MethodParameterApiDescriptionModel.Create(ParameterInfo parameterInfo)
   at System.Linq.Enumerable.SelectArrayIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
   at System.Linq.Enumerable.SelectArrayIterator`2.ToList()
   at Volo.Abp.Http.Modeling.ActionApiDescriptionModel.Create(String uniqueName, MethodInfo method, String url, String httpMethod, IList`1 supportedVersions, Nullable`1 allowAnonymous, String implementFrom)
   at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.AddApiDescriptionToModel(ApiDescription apiDescription, ApplicationApiDescriptionModel applicationModel, ApplicationApiDescriptionModelRequestDto input)
   at Volo.Abp.AspNetCore.Mvc.AspNetCoreApiDescriptionModelProvider.CreateApiModel(ApplicationApiDescriptionModelRequestDto input)
   at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.CreateScript(ProxyScriptingModel scriptingModel)
   at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.<>c__DisplayClass6_0.<GetScript>b__0()
   at System.Collections.Generic.AbpDictionaryExtensions.&lt;&gt;c__DisplayClass7_0`2.<GetOrAdd>b__0(TKey k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Volo.Abp.Http.ProxyScripting.ProxyScriptManagerCache.GetOrAdd(String key, Func`1 factory)
   at Volo.Abp.Http.ProxyScripting.ProxyScriptManager.GetScript(ProxyScriptingModel scriptingModel)
   at Volo.Abp.AspNetCore.Mvc.ProxyScripting.AbpServiceProxyScriptController.GetAll(ServiceProxyGenerationModel model)
   at lambda_method6129(Closure, Object, Object[])
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location ---
   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.&lt;InvokeNextExceptionFilterAsync&gt;g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

Steps to reproduce the issue**: 1 Start the application 2 Check the log.txt


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share some code to reproduce this?

    Thanks

  • User Avatar
    0
    drg_tverkroost created

    Attached some startup code. It occurs during the startup

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I can't get this error based on these codes. Can you share a simple project?

    liming.ma@volosoft.com
    https://wetransfer.com/

  • User Avatar
    0
    drg_tverkroost created

    How?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Its your project. Do you know how I can reproduce it locally?

Made with ❤️ on ABP v9.1.0-preview. Updated on December 12, 2024, 07:15