FormatException: An error occurred while deserializing the property of specific class

69 Views Asked by At

I'm working on the.net version migration from .NET 5 to .NET 8. Almost all the packages are updated using NuGet Package Manager, and the manual changes are also made. I'm using MongoDB, and the MongoDB driver is also updated to the latest version.

Then the project was also successfully built, but the thing is, after migration, every time I'm getting an error like

FormatException: An error occurred while deserializing

and saying some of the new attribute names are not in the entity. In some cases, it shows that truncation resulted in data loss. I attached the new versions that I updated, and I am wondering why I am getting some attribute missing errors.

These are the updated versions:

<PackageReference Include="AWSSDK.CloudWatch" Version="3.7.302.3" /> 
<PackageReference Include="AWSSDK.EventBridge" Version="3.7.302.17" /> 
<PackageReference Include="AWSSDK.S3" Version="3.7.305.27" />
<PackageReference Include="AWSSDK.SimpleNotificationService" Version="3.7.300.51" /> <PackageReference Include="AWSSDK.SQS" Version="3.7.300.51" /> <PackageReference Include="HiQPdf.Free.NetCore" Version="15.0.8" /> 
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" /> <PackageReference Include="MongoDB.Driver" Version="2.23.1" /> 
<PackageReference Include="RestSharp" Version="106.12.0" /> 
<PackageReference Include="SendGrid" Version="9.29.2" /> 
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.19.0.84025"> PackageReference Include="StrongGrid" Version="0.105.0" /> 
<PackageReference Include="System.ServiceModel.Http" Version="8.0.0" /> 
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" /> <PackageReference Include="UAParser" Version="3.1.47" /> 
<PackageReference Include="Wkhtmltopdf.NetCore" Version="3.0.2" /> 

I made a couple of changes, but still, I'm struggling with this. so I'm looking forward to your support to resolve this.

1

There are 1 best solutions below

0
Harendrra On

Thanks for all comments. I found a solution for this. So what i actually faced issue was when .net5 to .net 8 migration we have to careful with nugest versions.

  • List item I faced QRcoder version and downgraded to stable working version
  • List item refactored some of queries due to negative indexes are not supporting
  • List item my dev enviornment worked well and staging one didn't worked, then i found when we are migrating packages, we have to add latest record in migration collection into other dbs as well

recently i worked on .net5 to .net8 migration. so if you have any problem with it, add as a comment in to this. i will check and let you know what can you do for it. thanks