Base solution for your next web application
Open Closed

Test upgrade to .NET 7 - {"Method System.Linq.Enumerable.MaxFloat: type argument 'System.Int64' violates the constraint of type parameter 'T'."} #11423


User avatar
0
pliaspzero created

Hi,

I need to upgrade .NET CORE to .NET 7 - I've tested it - but get this error in startup class - app.UseAbp(options =>

Any idea / hint for me?

public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) {

       //Initializes ABP framework.
        app.UseAbp(options =>
     {
         options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
     });

"GenericArguments[0], 'System.Int64', on 'T MaxFloatT' violates the constraint of type 'T'."

{"Method System.Linq.Enumerable.MaxFloat: type argument 'System.Int64' violates the constraint of type parameter 'T'."}

" at System.RuntimeType.ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e)\r\n at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstantiation)\r\n at AutoMapper.TypeDetails.<>c__DisplayClass28_1.

{Void ValidateGenericArguments(System.Reflection.MemberInfo, System.RuntimeType[], System.Exception)}


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @pliaspzero

    Did you also upgrade AutoMapper to latest version ?

  • User Avatar
    0
    pliaspzero created

    Hi @ismcagdas,

    I think this could be the problem - I didn't update that - how to do that / what needs to be done? Thanks in advance!

  • User Avatar
    0
    pliaspzero created

    I've updated reference in .Core.csproj to this - but still not working - same error

    &lt;PackageReference Include=&quot;Abp.AutoMapper&quot; Version=&quot;7.4.0&quot; /&gt;
    
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    If you want to target .NET 7, you need to update all your Abp.* packages to 8.0. You also need to update AutoMapper to 12.0.0 and AutoMapper.Collection to 9.0.0.