Symptoms


After adding a reference to the VistaDB 6 library DLL my build reports the error:


Can not resolve reference: `System.Data.Entity`, referenced by `VistaDB.6`. Please add a NuGet package or assembly reference for `System.Data.Entity`, or remove the reference to `VistaDB.6`.


(or something similar)


Causes


As of version 6, VistaDB is now supported through NuGet packages in order to help ensure that the correct assembly file is used matching your target platform.  The 'System.Data.Entity' reference is part of older .NET Framework builds to support EF 4 and 5, but it is not part of .NET Standard/Core or .NET 6, and so you can get that error when not using the NuGet package and instead directly referencing a VistaDB DLL file which targets .NET Framework but in an application which targets .NET Core or .NET 6.0, for example.


Resolution


To correct this, make sure you reference the VistaDB.6 NuGet package rather than a specific DLL.  You'll need to remove the incorrect reference to the VistaDB DLL and then add the correct NuGet package reference.


If you've installed VistaDB 6 on your development machine you can find this and a few other version-specific NuGet packages in the "VistaDB 6" package source in the Package Manager in Visual Studio.  After opening the Package Manager, look for the "Package Source" drop-down selector in the upper-right corner of the Package Manager.


For more detailed instructions you can refer to this article.