This project has moved and is read-only. For the latest updates, please go here.

Running ManagedEsent with Linq support on .NET framework 4.0

Apr 16, 2013 at 9:26 AM
I would like to get .NET Framework 4.0 support including the LINQ support for PeristentDictionary. I download the solution and tried to compile the solution for .NET 4.0, but run into a problem til PredicateExpressionEvaluator and ColumnConverter which has references to the GetTypeInfo method and the TypeInfo class.

Are these dependency towards .NET 4.5 specific APIs central to the LINQ support? Is the test coverage so good that if I could implement these method without using 4.5 API, that the solution would work or would this probably break other part of the solution?
Apr 16, 2013 at 9:42 AM
No, they are not at all central to LINQ support.
You can sync to an older version, prior to the Immersive App support. Immersive support required that I move to net 4.5/coreclr. (No, PersistentDictionary doesn't actually work in Immersive at the moment, but hopefully it will one day.)

You can also add some stub classes / extension classes that implement GetTypeInfo().

Apr 16, 2013 at 9:46 AM
I tried a very simple workaround - just call the corresponding methods on the Type class instead of using the TypeInfo class and it all compiles and the tests I've run so far seem to work, but this is just a hack locally. I will try the compiled DLL in a our real project to see how it works.
Apr 16, 2013 at 9:54 AM
That's what what the pre-4.5 code does. But with 4.5 core, the Type class is greatly reduced (to allow better support on smaller devices). TypeInfo was introduced to avoid the type information code running when people didn't actually need it.
I don't anticipate any problems with your changes.

Apr 16, 2013 at 7:27 PM
The tests in the solution do give very good test coverage. If you want to run the complete test suite you will need IronPython installed. The script (in the EsentCollectionsTests directory) gives exhaustive, multithreaded coverage.
Aug 2, 2013 at 7:14 AM
Hi Team,

I have downloaded the latest dll's and used as a reference in my project "Esent.Interop.Wsa","Esent.Interop" and "Esent.Collections" . I have used then below code

var dictionary = new PersistentDictionary<string, string>("Names");
            Console.WriteLine("What is your first name?");
            string firstName = "Vijay";
            if (dictionary.ContainsKey(firstName))
                Console.WriteLine("Welcome back {0} {1}",
                    "I don't know you, {0}. What is your last name?",
                dictionary[firstName] = Console.ReadLine();
It is giving error on first line "Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

After then I have followed the documentation. I have copied and paste the Esent.Collection.dll and Inerop.dll to my project directory.
May be I am missing some thing here.

Thanks for for help.
Aug 6, 2013 at 8:10 PM
Thanks for the report. Are you targeting 4.0 or 4.5? You'll need to target 4.5.
The pre-built binaries may be built incorrectly. I will need to investigate.

Aug 7, 2013 at 10:17 AM
Thanks Martinc

My app is on 4.0 and also hosted on client server with 4.0 as well. Would you mind me guide if I want to work with 4.0 and could you please provide the steps or the sample code how to use these .dlls. I want to be sure what I am doing is right way of doing.
Aug 7, 2013 at 10:37 AM
You can download an older version of the DLL, prior to the changes that required 4.5. Those older versions aren't signed though.

It's not just a simple manner of retargeting 4.0; I need to make code changes for that to work. As mentioned above, the changes are related to the Type and TypeInfo classes, and I've simply not done the work that needs to be done to change the dependency on the 4.5-specific wrappers, and roll my own layer of indirection (that will work with 4.0).

Aug 7, 2013 at 10:46 AM
Thanks for your quick assistance MartinC.
Would it be fine downloading 1.6 version or which one should I to make things work?.

Thanks for you help.
Aug 7, 2013 at 10:57 AM
Yes, 1.6 ought to work just fine.
There were been some minor bug fixes since 1.6, but most of the changes were around adding new functionality.