Search code examples
c#databasencrunch

Why different DB Providers when using NCrunch and from Visual Studio


I have this code:

            var v = new List<string>();
            using (OleDbDataReader dataReader = OleDbEnumerator.GetRootEnumerator())
            {
                while (dataReader.Read())
                {
                    v.Add(string.Format("{0} - {1}", dataReader[0], dataReader[2]));
                }
            }
            var s = v.OrderBy(x => x).ToList();

When running in debug in visual studio I get this: enter image description here

when running in ncrunch I get this:

enter image description here

(I'm missing the Microsoft.ACE.OLEDB.12.0)

Can anyone explain why the list of providers are different in visual studio debug and in ncrunch?


Solution

  • It turns that it was, as suggested, related to 32bit vs 64bit builds.

    The .csproj for the production code used <PlatformTarget>AnyCPU</PlatformTarget> while the .csproj for the unit test used <PlatformTarget>x86</PlatformTarget>