Detecting SQL CE version

  • Thread starter Thread starter Richard Thombs
  • Start date Start date
R

Richard Thombs

Hi, I'm trying to detect the version of SQL CE installed on a device.
Well, in general it is the version of any assembly installed, so I can
use this information as part of an AutoUpdate framework.

I'm using Assembly.Load("System.Data.SqlServerCe") to try and extract
the assembly info, so I can then get the version information. However,
this fails with a System.IO.IOException and the message: "File or
assembly name 'System.Data.SqlServerCe', or one of its dependencies,
was not found."

This method works for locally installed assemblies, such as my
application and other DLLs that make it up. I was hoping that this
would also work for assemblies in the GAC. Is this not the case, or am
I missing something more obvious?

Thanks in advance,

Richard.
 
Well, I found in the docs that Assembly.Load specifically doesn't check
the GAC, and that Assembly.LoadWithPartialName, which will search the
GAC isn't available in the Compact Framework (why is all the cool stuff
never makes it in? :)

So, instead I'm just doing a FileVersionInfo check on one of the SQL
Mobile DLLs that get installed into /Windows. Not the best, but it
works!

R.
 
Back
Top