Deploying Orchard SQLCE on Remote Server

Topics: Installing Orchard, Troubleshooting
Jun 28, 2011 at 2:09 AM
Edited Jun 28, 2011 at 2:10 AM

Getting this error when I was testing deployment of Orchard to a remote server. I have been searching everywhere for a solution and nothing seems to work. Also, that article refers to 3.5 of SQLCE.

Server Error in '/' Application.

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.

Development: Win 7 Pro, using WebMatrix. Net 4.0, MVC 3.0 (obviously).

Remote: Win2008 Server. Originally had SQL Express 2008 with VS 2008. Installed WebMatrix, then installed VS Express 2010 so that I could update the MVC and SQL tools. My host is GoDaddy, HOWEVER, it is a virtual hosting platform that gives me a partition. I remotely access the server and control it. I updated the AppPool in IIS to use 4.0/integrated.

I used FileZilla to FTP the files.  I forgot to use "binary" transfer for the SQLCE (which I read somewhere) so I just re-did the App_Data folder (at first I just did an overwrite; when that didn't work I deleted that folder and uploaded it again in binary).

Sorry if this has been dealt with before, but I am really stumped and have spent hours trying to figure this out. Any help will be greatly appreciated.

REM

Coordinator
Jun 28, 2011 at 4:01 AM

You need to use binary transfer for *everything*. I would delete everything and start over.

Jun 28, 2011 at 12:38 PM

Thanks for the reply.  I just want to share my experience with others just in case they run into these issues.

I deleted the folder contents and FTP'd the entire website again using "binary" upload. The problem, however, persisted (same error).

Since I was just testing deployment, I figured I would just try re-adding the reference to SQLCE.  This did not work since it was already referenced (!), but it led me toward correcting the problem. 

I removed the reference and still no luck re-adding the reference, because a copy of the .dll was stored in the "/bin" folder. So I deleted that from the "/bin" folder and re-referenced the "NET" version (it shows up from the GAC)

I then received the following error:

***********

The IDbCommand and IDbConnection implementation in the assembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 


Exception Details: NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly System.Data.SqlServerCe could not be found. Ensure that the assembly System.Data.SqlServerCe is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.

*********

That led to a googleplex search, which turned up http://www.differentpla.net/content/2009/03/using-sql-server-compact-edition-unit-testing.  The relevant portion of the article (down by the middle of the page) was that I had to make sure "Local Copy" was set to "true".  However, since I am working with only the Orchard.Web folder (i.e., I open it as a website in WebMatrix or VS2010) and not the source, I do not have the ability to see the "Reference" folder in the Solution Explorer (maybe I am missing something).  So I just added a reference to the local SQLCE .dll found in the "private" folder on my production server.  And....it worked. :\

The moral of this story for you non-developers, is to either follow the above if you are only working with the website folder or, if you are working with source, just double-check that you have "Local Copy" set to "true".

I don't know if this warrants a blurb in the documentation.  Maybe under the heading "N00b's read me first". :)

-REM

Coordinator
Jun 28, 2011 at 5:53 PM

Are you saying that you built the Orchard.Web version from Visual Studio?

The GAC always wins over what's in bin, so from what you're saying it's likely that you had an older version of SQL CE (maybe beta) installed on that machine. I would start by uninstalling it (but not deleting anything from bin).

Jun 28, 2011 at 8:40 PM

I was using WebMatrix, so no build from VS. 

I thought the same thing when I originally encountered the error.  There was no install of SQL CE on the machine.  But what I did through the Web PI was to update SQL 2008 Express to the latest, then I had to install VS2010 Express in order to install the latest MVC and SQL tools.  I read somewhere on the googleplex that the SQL tools was causing that problem.  But, when I finally got through all those installs the problem persisted.

I know I did something wrong along the way.  What I may wind up doing (for other reasons as well) is dealing with the source, building it then deploying it in binary to avoid this completely.

Thanks again for the responses.