[Mono-list] Re: MySQL Connection from .NET Website (David P. Donahue)

Joe Audette joe_audette@yahoo.com
Thu, 3 Feb 2005 06:52:22 -0800 (PST)


--0-2010782795-1107442342=:20776
Content-Type: text/plain; charset=us-ascii

I have all my data access code in a separate class library project and I have to compile it on the linux machine to get it to work for the same reason.
 
On the windows machine I have the ByteFx source code compiled with Rebuild, but it references sharpziplib which is an already compiled dll that is probably not done with Rebuild.
 
>From the Build menu in VS.NET I use Rebuild Solution. I haven't tried this but my theory is if you get the source code to sharpziplib and compile it with Rebuild and make ByteFx reference the newly compile dll so that everything in the chain is compiled with rebuild it should work. 
 
I've been too busy to try this theory myself. since all my data access code is in one class file, I just compile it on linux using monodevelop though you could also use the command line compiler. I don't have the ByteFx dll in my bin folder either since it is already in the GAC after installing it from the optional mono packages.
 
Hope it helps,
 
Joe


"David P. Donahue" <ddonahue@ccs.neu.edu> wrote:
"System.IO.FileNotFoundException: File 
'/home/www/.www/test/bin/ByteFX.MySqlClient.dll' not found."

:)

You are correct, I'm compiling with VS .NET 2003. Basically, what I 
have here is a single-page C# site which does nothing more than attempt 
to connect to the database and populate a data list from a very simple 
query, all just for testing the basic functionality.

When compiling, I generally just go to the Build menu and choose Build 
Solution. Per your advice, I looked around for other methods in the 
interface. I found the Batch Build option under that same menu to have 
an entry for Debug and an entry for Release. I checked the Release 
entry, clicked the Build button, got the above error when trying to run 
it from Mono. I then returned to Batch Build and clicked the Rebuild 
button and tried again, but the same error above was returned.

Am I still doing something wrong? What are the proper steps in the VS 
interface for building this the way I need it? Conversely, you 
mentioned compiling under Linux. I've found information for compiling 
an application with Mono, but what are the proper steps for compiling an 
ASP .NET site with Mono?

Thank you for your help.


Regards,
David P. Donahue
ddonahue@ccs.neu.edu



Joe Audette wrote:
> I've seen this many times. It says file not found but
> more accurate would be "Couldn't load assembly".
> 
> Are you compiling it on windows with vs.net then
> deploying it on linux?
> If so, you will get that error unless you use release
> build and rebuild (not just build). mono doesn't like
> the vs.net incremental builds. Also if there is any
> other dotnet assemblies in the dependency chain for
> the MySQL .NET connector (I'm thinking sharpziplib
> might be one) it also has to be compiled with release
> rebuild.
> Alternatively you can compile on the linux machine and
> it should work.
> 
> For the MySQL .NET connector, you might also consider
> installing it in the GAC (Global Assembly Cache). I
> haven't done this yet so I'm not sure how but I am
> sure its possible.
> 
> Your other option is don't use the .NET Connector, use
> the previous version under the ByteFx.Data namespace.
> It ships with mono and is already in the GAC if you
> installed it. Thats what I use for mojoPortal running
> MySQL.
> 
> Hope that helps,
> 
> Joe Audette
> 
> http://www.mojoportal.com
> http://www.joeaudette.com
> 
> --- "David P. Donahue" 
   wrote:



joe_audette@yahoo.com
http://www.joeaudette.com
http://www.mojoportal.com
		
---------------------------------
Do you Yahoo!?
 The all-new My Yahoo! – What will yours do?
--0-2010782795-1107442342=:20776
Content-Type: text/html; charset=us-ascii

<DIV>
<DIV>I have all my data access code in a separate class library project and I have to compile it on the linux machine to get&nbsp;it to work for the same reason.</DIV>
<DIV>&nbsp;</DIV>
<DIV>On the windows machine I have the ByteFx source code compiled with Rebuild, but it references sharpziplib which is an already compiled dll that is probably not done with Rebuild.</DIV>
<DIV>&nbsp;</DIV>
<DIV>From the Build menu in VS.NET I use Rebuild Solution. I haven't tried this but my theory is if you get the source code to sharpziplib and compile it with Rebuild and make ByteFx reference the newly compile dll so that everything in the chain is compiled with rebuild it should work. </DIV>
<DIV>&nbsp;</DIV>
<DIV>I've been too busy to try this theory myself. since all my data access code is in one class file, I just compile it on linux using monodevelop though you could also use the command line compiler. I don't have the ByteFx dll in my bin folder either since it is already in the GAC after installing it from the optional&nbsp;mono packages.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Hope it helps,</DIV>
<DIV>&nbsp;</DIV>
<DIV>Joe<BR><BR><BR><B><I>"David P. Donahue" &lt;ddonahue@ccs.neu.edu&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">"System.IO.FileNotFoundException: File <BR>'/home/www/.www/test/bin/ByteFX.MySqlClient.dll' not found."<BR><BR>:)<BR><BR>You are correct, I'm compiling with VS .NET 2003. Basically, what I <BR>have here is a single-page C# site which does nothing more than attempt <BR>to connect to the database and populate a data list from a very simple <BR>query, all just for testing the basic functionality.<BR><BR>When compiling, I generally just go to the Build menu and choose Build <BR>Solution. Per your advice, I looked around for other methods in the <BR>interface. I found the Batch Build option under that same menu to have <BR>an entry for Debug and an entry for Release. I checked the Release <BR>entry, clicked the Build button, got the above error when trying to run <BR>it from Mono. I then returned to Batch Build and clicked the Rebuild <BR>button and tried again, but the same error above
 was returned.<BR><BR>Am I still doing something wrong? What are the proper steps in the VS <BR>interface for building this the way I need it? Conversely, you <BR>mentioned compiling under Linux. I've found information for compiling <BR>an application with Mono, but what are the proper steps for compiling an <BR>ASP .NET site with Mono?<BR><BR>Thank you for your help.<BR><BR><BR>Regards,<BR>David P. Donahue<BR>ddonahue@ccs.neu.edu<BR><BR><BR><BR>Joe Audette wrote:<BR>&gt; I've seen this many times. It says file not found but<BR>&gt; more accurate would be "Couldn't load assembly".<BR>&gt; <BR>&gt; Are you compiling it on windows with vs.net then<BR>&gt; deploying it on linux?<BR>&gt; If so, you will get that error unless you use release<BR>&gt; build and rebuild (not just build). mono doesn't like<BR>&gt; the vs.net incremental builds. Also if there is any<BR>&gt; other dotnet assemblies in the dependency chain for<BR>&gt; the MySQL .NET connector (I'm thinking sharpziplib<BR>&gt;
 might be one) it also has to be compiled with release<BR>&gt; rebuild.<BR>&gt; Alternatively you can compile on the linux machine and<BR>&gt; it should work.<BR>&gt; <BR>&gt; For the MySQL .NET connector, you might also consider<BR>&gt; installing it in the GAC (Global Assembly Cache). I<BR>&gt; haven't done this yet so I'm not sure how but I am<BR>&gt; sure its possible.<BR>&gt; <BR>&gt; Your other option is don't use the .NET Connector, use<BR>&gt; the previous version under the ByteFx.Data namespace.<BR>&gt; It ships with mono and is already in the GAC if you<BR>&gt; installed it. Thats what I use for mojoPortal running<BR>&gt; MySQL.<BR>&gt; <BR>&gt; Hope that helps,<BR>&gt; <BR>&gt; Joe Audette<BR>&gt; <BR>&gt; http://www.mojoportal.com<BR>&gt; http://www.joeaudette.com<BR>&gt; <BR>&gt; --- "David P. Donahue" <DDONAHUE@CCS.NEU.EDU>wrote:<BR></BLOCKQUOTE></DIV><BR><BR>joe_audette@yahoo.com<br>http://www.joeaudette.com<br>http://www.mojoportal.com<p>
		<hr size=1>Do you Yahoo!?<br> 
The <a href="http://my.yahoo.com">all-new My Yahoo!</a> – What will yours do?
--0-2010782795-1107442342=:20776--