views:

132

answers:

2

Hello, I'm working on getting my ASP.Net project working on Linux. I've been testing my code using XSP on windows, but now I am trying to make sure that I can develop and test on Linux as well. To that end I've gotten Ubuntu running and have MonoDevelop and MySQL running. I've downloaded the latest MySQL Connector/Net and I think I have it installed correctly.

There is no package that will automatically install the MySQL Connector/Net for distribution so I downloaded the 6.2.3 zip file from the MySQL website. Now I've already discovered the issue with case sensitivity because the zip file contains filenames in lowercase, and Mono expects them in uppercase. So I've changed the names of the files to MySql.Data.dll, and MySql.Web.dll respectively. I've also used gacutil to install both files to the GAC. Likewise I have added the files to the Mono Lib directory. The following files do exist on my machine:

/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll
/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll
/usr/lib/mono/2.0/MySql.Data.dll
/usr/lib/mono/2.0/MySql.Web.dll

I've also created package files so that I can add references to the the assemblies in MonoDevelop. The folder /usr/lib/mono/2.0 contains two .pc files that I added.

MySql.Web.pc:

Name: MySql.Web
Description: ASP Membership, Role and Profile providers powered by MySQL
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Web/6.2.3.0__c5687fc88969c44d/MySql.Web.dll

MySql.Data.pc:

Name: MySql.Data
Description: Provides connectivity to MySQL databases
Version: 6.2.3
Libs: -r:/usr/lib/mono/gac/MySql.Data/6.2.3.0__c5687fc88969c44d/MySql.Data.dll

At this point I can use the assemblies in projects inside MonoDevelop. The Assemblies appear in the list of available assemblies when I edit the project references. The project now compiles without error inside MonoDevelop. However when I run the compiled web project in XSP the following error is displayed in the browser:

System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Web.dll, Version=6.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' or one of its dependencies. The system cannot find the file specified.

What is fustrating is that originally the error was that it could not load MySql.Data.dll and now the error message is that it can not load MySql.Web.dll. Which means that I somehow fixed the problem I was having with the Data dll, and now I have the problem with the Web dll. I have gone and re-done I learned to fix the problem for the Data dll, but I am unable to get the Web dll working.

Unfortunately I'm still pretty new to Linux and Mono (but not to ASP.Net) and I've run out of things to try. Likewise I haven't found anything on Google to try other than what has been described above which leaves me asking for help.

Can anyone help me find out why XSP can't find the assembly and what I can do about it?

Thanks, -Will

A: 

Not a perfect fix (I don't know why its going wrong), but if you're in a hurry, copy MySql.Web.dll to the bin directory of your app.

David Archer
What I've got is an ASP.Net Web Project which compiles everything into a ProjectName.dll file in a bin folder. I've got the MySql dll files in that folder but there is no change in the output displayed in the browser.
William Leader
+1  A: 

You can try setting some environment variables which should tell you where all Mono is looking for assemblies:

MONO_LOG_LEVEL="debug" MONO_LOG_MASK="dll" xsp2

jpobst
I did get some output that may be relevant. See it here (docs.google.com/View?id=dvwt9nw_45f5t7crdx). What is interesting is that it shows MySql.Data.dll being loaded (it is first in my Web.config file). Then it attempts to load MySql.Web.dll but is followed by errors loading libc.so.6. My interpretation is that I am missing that library, but I could be wrong. Any ideas what to do next?
William Leader
You might want to check the MySql website and see if MySql.Data is compatible with Mono.
jpobst
I don't think it is a compatibility problem. I did notice in log you helped me generate that at one point it attempts to look for the dll at /usr/lib/MySql.Web.dll. I placed the file there and the site does run now. However I believe this is a symptom of a bug somewhere. What happens when I have two applications that depend on different versions of the dll. I can't have two versions of the same dll in /usr/lib. I don't know why it can't use one of the other 3 copies of the file (one in project bin, one in GAC, and one in /usr/lib/mono/2.0)
William Leader