Detecting SQL CE version

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.
 
R

Richard Thombs

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top