Compact Framework & Adding reference to System * problem
Marcus Grenängen, 2010-07-12 14:43
We've been having some problems with Compact Framework and referencing assemblies from the 3.5 release. The problem shows during compile time with a nice message like "Consider app.config remapping of assembly "System.Data, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes" from Version "2.0.0.0" [] to Version "3.5.0.0" [c:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\System.Data.dll] to solve the conflict and get rid of all warnings."
After doing some investigation and googling around I solve (or rather made the warning message go away) by adding this to a our app.config file.
<configuration>
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- 2.0 to 3.5 -->
<dependentassembly>
<assemblyidentity culture="neutral" publickeytoken="969db8053d3322ac" name="System.Data" />
<bindingredirect newVersion="3.5.0.0" oldVersion="2.0.0.0" />
</dependentassembly>
<!-- 1.0 to 3.5 -->
<dependentassembly>
<assemblyidentity culture="neutral" publickeytoken="969db8053d3322ac" name="System.Data" />
<bindingredirect newVersion="3.5.0.0" oldVersion="1.0.5000.0" />
</dependentassembly>
</assemblybinding>
</runtime>
</configuration>
This will ensure that the warnings goes away. But be aware that if the app.config is deployed into the device as the app.exe.config, the start-up time of your application may be affected since the CLR will attempt to decipher the config file.

