简体   繁体   中英

While upgrading Web API from Visual studio 2022 Version 3.1 to Version 6.0 exception is occurred

I am trying to upgrade.Net core Web API application from 3.1 to 6.0 and after upgrading a exception is displayed while compiling:

"{"StatusCode":500,"Message":"The type initializer for 'Microsoft.EntityFrameworkCore.Query.ResultOperators.Internal.TrackingExpressionNode' threw an exception."}"

在此处输入图像描述

I think I've seen this issue myself.

If it's the same thing then it's an easy fix.

Find your nuget package for entity framework core and try updating it to the latest version. I think older versions are incompatible with.Net 6.

Looking at a scratch app I have which compiles to.net 6

I can add

  <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM