[CSHARP-2394] Remove dependency on System.Reflection.Emit Created: 24/Sep/18  Updated: 28/Oct/23  Resolved: 24/Jan/20

Status: Closed
Project: C# Driver
Component/s: Serialization
Affects Version/s: None
Fix Version/s: 2.11.0

Type: Bug Priority: Minor - P4
Reporter: Vincent Kam (Inactive) Assignee: Dmitry Lukyanov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to CSHARP-2332 Error installing MongoDB.Bson package... Closed
is related to CSHARP-2592 Add .NET Standard 2.0 support Closed

 Description   

More research is needed, but it appears that System.Reflection.Emit may not actually work on .NET Standard (it will only work on .NET Framework and .NET Core). Craig has suggested that we can remove the code in BsonMemberMap and compile a Linq expression tree instead

It's likely that most of our customers are either using .NET Framework and .NET Core, so this is not a high priority bug.

More information can be found here:
https://github.com/dotnet/corefx/issues/29365



 Comments   
Comment by Githook User [ 24/Jan/20 ]

Author:

{'username': 'DmitryLukyanov', 'name': 'DmitryLukyanov', 'email': 'dmitry.lukyanov@mongodb.com'}

Message: CSHARP-2394: Remove dependency on System.Reflection.Emit.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/49cac7f3ed6b873c31ddafb9f41b8e426fd4a372

Comment by Chris Timberlake [ 13/Aug/19 ]

Thanks James, this look good and useful!

For anyone who is looking at this from a Xamarin side. The new Xamarin Interpreter can handle the .Emit code if necessary. https://gitlab.demo.i2p.online/solutionarchitect/openshift/octanukitech/blob/master/.gitlab-ci.yml

Comment by Jimmy Bogard [ 13/Aug/19 ]

FYI I fixed this in my `netstandard2.0` PR:

https://github.com/mongodb/mongo-csharp-driver/pull/377

Comment by Chris Timberlake [ 29/Apr/19 ]

This is a blocking issue for Xamarin Applications. On Mac, all iOS Xamarin Applications are built with .Net Standard 2.0. Which does not contain System.Reflection.

Generated at Wed Feb 07 21:42:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.