AnsweredAssumed Answered

Unit testing with a database file for Arcgis Pro SDK

Question asked by ycarrieresri-ca-esridist Employee on Sep 26, 2019
Latest reply on Sep 27, 2019 by ycarrieresri-ca-esridist

Hi, I'm looking for a way to test the result of a query to a geodatabase and/or sqlite database file when running unit tests with Nunit in C# (Visual Studio 2017 Enterprise) for an add-in. Right now, I always get an error about this missing DLL: MappingCoreLib.dll when I create a queudTask to open the database even if I added this DLL in the project. I had the same issue with DADFLib.dll but adding the file to the project solved the issue for this specific file.

 

When I run the add-in, everything is working fine and the add-in project is compiling without issue which mean the SDK is correctly installed.

 

The problem happen when I run this section of my unit test:

if (File.Exists(gdbFile.AbsolutePath))
{
Database database;

await QueuedTask.Run(() =>
{
using (database = new Database(new SQLiteConnectionPath(gdbFile)))
{
database.OpenTable(database.GetQueryDescription("ROADS"));
}
});
}

 


Error message: System.DllNotFoundException: 'Unable to load DLL 'MappingCoreLib.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'

 

This error happen when trying to open gdb or a sqlite file.

 

Anybody had this issue before and know a way to solve it? Thank you

Outcomes