> I am getting the following error:
"Could not load file or assembly 'xxx' or one of its dependencies. The system cannot find the file specified."
> Do I have to use that specific version?
> I would like to use a new version!
Usually, this problem appears when you try to set a Connection property for one of the MetadataProvider objects that refer to a third-party .NET DB provider assembly.
There are two ways to solve the problem:
1. Assign the Connection property in code.
You cannot set this property in Visual Studio as the IDE itself loads assemblies without the binding redirection, but Visual Studio automatically adds it to the 'app.config' file of your project, so the same operation will work in runtime. Thus, you can assign your DB provider to the Connection property in code and that will work just fine!
2. Recompile the source code of a metadata provider with the right version of .NET DB Provider.
Source code of all metadata providers are available in all versions, including the trial version, so you can recompile the needed providers with those versions of DB providers that you have (and the needed version of .NET Framework), or you can simply include a source code project of necessary metadata providers right into your solution.
You can find the source code in the "%USERPROFILE%\Documents\Active Query Builder 3.x .NET Source Code" folder.
On a side note, assembly binding redirection is automatically configured by the Visual Studio. In case it won't, you can set it up manually as follows.
To use any other version of dependent assembly you must override the version binding using the following 'app.config' file (add it to your project):
<?xml version="1.0" encoding="utf-8" ?> <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="VistaDB.NET20" publicKeyToken="dfc935afe2125461" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="184.108.40.206" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
Change the name, publicKeyToken and newVersion attributes to the required values.
More information can be found in the following MSDN articles: