My application references a library project that has System.Data.SqlServerCe 4.0.0.0 as a dependency.
I'm trying to private deploy my app, however, which requires System.Data.SqlServerCe 4.0.0.1.
So, I set up my app so that System.Data.SqlServerCe 4.0.0.1 gets copied into the output directory (into the same folder as the executable), and I added an assemblyBinding to my App.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="System.Data.SqlServerCe.dll"
publicKeyToken="89845dcd8080cc91" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.0.0.1" />
<codeBase version="4.0.0.1" href="System.Data.SqlServerCe.dll" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Unfortunately, I'm getting this error:
Could not load file or assembly 'System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0X80131040)
Question
Is it possible to swap System.Data.SqlServerCe 4.0.0.0 with version 4.0.0.1 at runtime to allow for private deployment?