Home Dashboard Directory Help

Certain symbols in application path prevent SQL Server Compact from loading by Steve Rukuts


 as Not Reproducible Help for as Not Reproducible

Sign in
to vote
Type: Bug
ID: 692895
Opened: 10/3/2011 4:05:00 PM
Access Restriction: Public
User(s) can reproduce this bug


When System.Data.SqlServerCe has been copied to a path that contains certain symbols, the application will crash with the following error message:

System.Data.SqlServerCe.SqlCeException: Unable to load the native components of SQL Server Compact corresponding to the ADO.NET provider of version 8482. Install the correct version of SQL Server Compact. Refer to KB article 974247 for more details.

The workaround for this issue that I found was to rename the directory. The application directory was called "C#", renaming it to "CSharp" solved the issue. I found this by using ReSharper to step through System.Data.SqlServerCe to find this line in NativeMethods.LoadNativeBinaries():

string localPath = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;

The Uri class ignores everything after the #, meaning that if the path is "c:\applications\c#\myapp1\bin\debug", the path will be truncated to "c:\applications\c".
Sign in to post a comment.
Posted by Microsoft on 3/5/2012 at 12:30 PM
Hello Steve,
Sorry for the late feedback. We looked at this and could not repro the issue. It will be good if you can provide more details. So for now, I am closing this item - please reopen if you can repro the issue.
Details on what we tried:

I could not repro this issue with SQLCE 3.5 sp2 32-bit and 64 bit setup and SQLCE 4.0 64 bit setup.

I created a SQLCE application in the folder path that contains '#' character. The application references sqlce mangaed dll and creates a db, opens a connections, inserts some records.

C:\Users\rusurla\Documents\Visual Studio 2010\Projects\C#\WindowsFormsApplication1\WindowsFormsApplication1\bin\x64\Debug\WindowsFormsApplication1.dll

Umachandar, SQL Programmability Team
Posted by Microsoft on 10/18/2011 at 12:28 AM
Thanks for logging the issue. We are analyzing the issue and will post back more information after the analysis is complete.


Sign in to post a workaround.