This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm creating a LightSpeedContext in code. The line "_context.DataProvider = DataProvider.SqlServerCE4;" causes the following exception: System.IO.FileNotFoundException: Could not load file or assembly 'file:///Z:\[...]\Mindscape.LightSpeed.Providers.SqlServerCe4.dll' or one of its dependencies. The dll is referenced and is present in the output folder. I've tried "devenv /resetskippkgs" but I still get the same exception. Vikram |
|
|
This may indicate that one of the dependencies is missing. I seem to recall seeing issues with the xcopy version of the SQL CE 4 CTP; you may need to run the CE 4 installer. You may be able to get more info about which file it's not finding using fuslogvw (though this isn't always very helpful) or Process Monitor. |
|
|
Just a question, did you include the Mindscape.LightSpeed.Providers.SqlServerCe4.dll as a reference in your project? If not you can find it in \Program Files\Mindscape\LightSpeed\Providers\SqlServerCE\ folder.
Johan |
|
|
Johan, Yes, Mindscape.LightSpeed.Providers.SqlServerCe4.dll is referenced and I can see it in the application folder. No joy. I'm baffled.
Best,
|
|
|
And... SqlCE 3.5 works perfectly, but always get the exception with 4.0, with a private install and otherwise. Vikram |
|
|
Hi Vikram,
Please try the attached project. You will just have to create the database via the designer.
Johan |
|
|
It is compiled against the July CTP, file version 4.0.8402.1. |
|
|
The sample project was causing the exception too. But, apparently the SqlCE 4.0 dll, despite being a local file causes a sandboxing error. More information here. Adding the following to the app.config fixed the problem: <runtime> <loadFromRemoteSources enabled="true"/> </runtime> |
|
|
I'm getting a similar error (see below). I'm running Win 7 32-bit, VS2010 Ultimate, and the Lightspeed from 10/27/10. I just tried moving over from MSSQL to SQLCE 4 tonight. I added the Mindscape.LightSpeed.Providers.SqlServerCe4.dll to my project as a reference. When running the ASP.NET MVC app from VS, I get this error. Vikram's solution didn't appear to work for me when modifying Cassini's config file. Any ideas? Could not load file or assembly 'file:///C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0\Mindscape.LightSpeed.Providers.SqlServerCe4.dll' or one of its dependencies. The system cannot find the file specified. |
|
|
Here's the callstack, if that helps:
|
|
|
It looks like it's searching for the assembly in the Cassini directory, rather than in the project output directory, which seems a bit weird. Maybe that's the way Cassini does things, but expecting user files to be in %ProgramFiles%\Common Files doesn't seem right to me. I'm guessing this may be an ultimate fallback location after probing elsewhere has failed. My guess would be that it's missing the CE engine DLL dependency. Try referencing the CE engine DLL directly from your project, and verify that the CE DLL is in the project output directory. As mentioned above, I have seen issues with the xcopy version of the CE DLL. If you haven't done so already, it may be worth running the CE installer to see if that helps. Failing that, see if fuslogvw or procmon can tell you exactly which DLL is failing to load and exactly where it is looking. |
|
|
I've been bashing around with Fuslogvw and procmon to try and get more info, but nothing is obvious or forthcoming. Has anyone used the Lightspeed SQLCE 4 provider in an ASP.NET environment (I use MVC but I don't know that that matters)? I've installed the full SQLCE 4 bits from here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=0d2357ea-324f-46fd-88fc-7364c80e4fdb&displaylang=en I used NuGet to install-package SQLCE to my project. This gives me a later version of MSSQLCEthan the install listed above. I added a reference to System.Data.SqlServerCe.dll and Mindscape.LightSpeed.Providers.SqlServerCE4.dll. I've tried to copy the native image files from the packages\SQLCE.4.0.8435.1 x86 directory to the bin directory, and to the Lightspeed bin directory. I end up with the following fuslog. Maybe the Lightspeed provider should be using a different mechanism for loading the assembly? Or (more likely), I've completely botched how things are supposed to be setup. If anyone can even tell me that they have this working in ASP.NET MVC, that would at least give me hope to keep digging. Thanks.
*** Assembly Binder Log Entry (12/8/2010 @ 3:36:30 PM) *** |
|
|
Hmm, might be a versioning issue. LightSpeed is looking for version 4.0.8402.1. Have you tried an assembly binding redirect from 4.0.8402 to 4.0.8345? |
|
|
I backed off to use the older version and still no luck. I put together a demo app and sent you an email. I really hope it fails for you, too! :) Let me know if you need anything from me. Thanks. |
|
|
Yep, failed for us too! Thanks! We've implemented a fix and it will be in the next nightly build. Please note we have not updated the provider to a more recent version of SQL Server CE. So you may still need to use the older version of CE or provide a binding redirect. We'll try to get onto this reasonably soon. (Also, there will be a first-chance exception when loading under Cassini. This may look alarming if you have VS set to "break on throw," but it's benign and can be ignored.) |
|
|
Thank you, Ivan! Does that mean the build labelled 12/13 or 12/14 will have it? I'll report back with any interesting findings. |
|
|
The 13th -- it's up there now. |
|