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.