[CSHARP-4201] MongoDB.Driver not supporting AOT native build Created: 08/Jun/22 Updated: 16/Jun/22 Resolved: 16/Jun/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Jaafar N/A | Assignee: | Boris Dogadov |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Generic exception not supported by AOT native build, is there anyway to change generic exception from your side? Please check this for more details
https://github.com/dotnet/runtime/issues/70400 |
| Comments |
| Comment by Boris Dogadov [ 16/Jun/22 ] |
|
We are glad that you found a workaround for this issue. Given that this issue might to be fixed .NET 7 final release, we are closing this driver issue as Won't Fix. If it is present in the final release of .NET 7, please re-open this issue so that we can re-triage the problem. |
| Comment by Jaafar N/A [ 14/Jun/22 ] |
|
Thank you for looking into it, The problem with catching generic exception, you need c# application and add Microsoft.ILComplier for AOT native build. I mange to solve it by downloading MangoDB.Driver project code, and I have updated the generic exception catch (MongoBulkWriteException<TDocument> ex) to catch (Exception ex) when (ex is MongoBulkWriteException<TDocument>) {{}} In the following file {{}} Then it worked with native build |
| Comment by Boris Dogadov [ 13/Jun/22 ] |
|
Hi jaafar.abusair@gmail.com, We could not easily reproduce this issue. Thanks |
| Comment by Boris Dogadov [ 08/Jun/22 ] |
|
Hi jaafar.abusair@gmail.com, thank you for your question, we will be looking into it. |