[Mono-list] How do i tell Mono (for ASP.NET, C#) where to find MySQL.Data.MySqlClient

Dick Steflik steflik at binghamton.edu
Mon Oct 23 12:40:07 EDT 2006


Peter,
Thanks for butting in; answering your questions:
First: I think the GAC is kinda like the Windows registry in that it 
allows me to make use of Windows dynamic link libraries that haven't 
been written to us windows specific APIs
Second: Focusing only on ASP.NET it searches for a referenced assembly 
in web.config then in the application /bin director or vice versa; or is 
there somthing else happening?.
Third: this is pretty vague to me

When I look in the GAC using gacutil I can see everything that has been 
registered but I don't see anything that says where the assemblies are 
physically located.

Explanations would be helpful, I'm trying to get this running for a 
class I'm teaching and would really hate to have many copies of the .dll 
laying around in the /bin directories of the student applications. Most 
of my experience has been with Tomcat, JBoss, JSPs, servlets and Java 
Web Services and am trying to give unbiased coverage to PHP and 
ASP.NET.  The similaritiest between ASP.NET with C# and Java Server 
Pages and servlets is quite uncanny.

Thanks for being patient.
Dick Steflik
Binghamton University

Bradley, Peter wrote:

>Dick,
>
>I'm sorry to butt in, but I noticed things looked as though they might
>start recursing.  Infinitely, possibly :)
>
>First up: do you understand what the GAC is?
>
>Second: do you understand how the .NET Framework searches for referenced
>assemblies?
>
>Third: do you understand what strongly named assemblies are, and how you
>refer to them (i.e. with their strong name)?
>
>If you have a problem with any of these, perhaps we should take a step
>back and explain some of those things first.  If you already understand
>all that stuff, please just ignore me and I promise I'll go away.
>
>
>Peter
>
>
>-----Original Message-----
>From: mono-list-bounces at lists.ximian.com
>[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Robert Jordan
>Sent: 23 October 2006 15:40
>To: Mono-list at lists.ximian.com
>Subject: Re: [Mono-list] How do i tell Mono (for ASP.NET,C#) where to
>find MySQL.Data.MySqlClient
>
>Dick,
>
>steflik wrote:
>  
>
>>Thanks for the patience but I got the same result. If the
>>    
>>
>MySql.Data.dll 
>  
>
>>isn't in the /bin directory the compuiler can't find it. This may
>>    
>>
>sound 
>  
>
>>stupid but what directory shoiuld the .dll be in?
>>    
>>
>
>In the GAC (Global Assembly Cache), see (1) below.
>
>Robert
>
>  
>
>>Thanks,
>>
>>Dick Steflik
>>Binghamton University
>>
>>Robert Jordan wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>Here we go:
>>>
>>>1) install MySql.Data into the GAC:
>>>
>>>gacutil -i MySql.Data.dll
>>>
>>>2) obtain MySql.Data's assembly name:
>>>
>>>gacutil -l MySql.Data
>>>
>>>The output should look like this (in one line), but
>>>your version might be different:
>>>
>>>MySql.Data, Version=1.0.7.30073, Culture=neutral, 
>>>PublicKeyToken=8e323390df8d9ed4
>>>
>>>
>>>3) create "web.config":
>>>
>>><?xml version="1.0" encoding="utf-8" ?>
>>><configuration>
>>>  <system.web>
>>>    <compilation debug="true">
>>>      <assemblies>
>>>        <!-- insert *your* assembly name -->
>>>        <add assembly="MySql.Data, Version=1.0.7.30073, 
>>>Culture=neutral, PublicKeyToken=8e323390df8d9ed4" />
>>>      </assemblies>
>>>    </compilation>
>>>  </system.web>
>>><configuration>
>>>
>>>4) create a demo page "demo.aspx"
>>>
>>><%@ Page %>
>>><%@ Import namespace="MySql.Data.MySqlClient" %>
>>><script runat="server">
>>>void Page_Load (object sender, EventArgs e)
>>>{
>>>	// test whether we can create a dummy connection
>>>        MySqlConnection con = new MySqlConnection ();
>>>}
>>></script>
>>><html>
>>><body>
>>></body>
>>></html>
>>>
>>>
>>>Robert
>>>		
>>>
>>>steflik wrote:
>>> 
>>>
>>>      
>>>
>>>>Robert,
>>>>I'ver built the web.config and done everything you said to but Mono 
>>>>still can't find MySql.Data.
>>>>
>>>>I tried putting the MySql.Data.dll in the application /bin directory
>>>>        
>>>>
>and 
>  
>
>>>>that seems to work but the better way to do this would be via the 
>>>>web.config.
>>>>
>>>>I'm trying to use Mono for an ASP.NET segment for a class I teach on
>>>>        
>>>>
>web 
>  
>
>>>>programming here at the University and I really hate to have each of
>>>>        
>>>>
>the 
>  
>
>>>>students place the .dll in their /bin directory.
>>>>
>>>>Dick Steflik
>>>>Binghamton University
>>>>
>>>>Robert Jordan wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Hi,
>>>>>
>>>>>You have to create web.config in the directory of the ASP.NET
>>>>>application. Have a look at the test site that that gets
>>>>>installed into $prefix/lib/xsp/test.
>>>>>
>>>>>MySql.Data.MySqlClient is just a namespace. The assembly is
>>>>>MySql.Data.
>>>>>
>>>>>Robert
>>>>>
>>>>>steflik wrote:
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>Robert,
>>>>>>I'm new at this, where do I find the web.config file, I've been
>>>>>>            
>>>>>>
>looking
>  
>
>>>>>>around and it isn't obvious.  Also, my the impot that is failing
>>>>>>            
>>>>>>
>is
>  
>
>>>>>>"import MySql.Data.MySqlClient"; is that the assembly you are 
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>referring to?
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>Dick Steflik
>>>>>>
>>>>>>Robert Jordan wrote:
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>Dick Steflik wrote:
>>>>>>>
>>>>>>>
>>>>>>>         
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>>>>I can get Mono to build a command line program using MySql (and
>>>>>>>>                
>>>>>>>>
>it
>  
>
>>>>>>>>runs nicely)  but I have to tell the C# compiler where the dll
>>>>>>>>                
>>>>>>>>
>is.
>  
>
>>>>>>>>How do I do this for ASP.NET using C#.
>>>>>>>>I'm using Mono on FC5 with Apache and Mono 1.1.17....
>>>>>>>>
>>>>>>>>           
>>>>>>>>
>>>>>>>>                
>>>>>>>>
>>>>>>>Copy the MySql assembly into the bin folder of your ASP.NET app
>>>>>>>or install the assembly into the GAC and specify the assembly
>>>>>>>              
>>>>>>>
>name
>  
>
>>>>>>>in the web.config:
>>>>>>>
>>>>>>><configuration>
>>>>>>><system.web>
>>>>>>><compilation>
>>>>>>><assemblies>
>>>>>>>  <add assembly="MySql.Data, Version=x.x.x.x, Culture=neutral,
>>>>>>>PublicKeyToken=...."/>
>>>>>>></assemblies>
>>>>>>></compilation>
>>>>>>></system.web>
>>>>>>></configuration>
>>>>>>>
>>>>>>>You can obtain the full assembly name with
>>>>>>>
>>>>>>>gacutil -l | grep MySql
>>>>>>>
>>>>>>>Robert
>>>>>>>
>>>>>>>_______________________________________________
>>>>>>>Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>>>>http://lists.ximian.com/mailman/listinfo/mono-list
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>         
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>_______________________________________________
>>>>>Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>>http://lists.ximian.com/mailman/listinfo/mono-list
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>_______________________________________________
>>>>Mono-list maillist  -  Mono-list at lists.ximian.com
>>>>http://lists.ximian.com/mailman/listinfo/mono-list
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>_______________________________________________
>>>Mono-list maillist  -  Mono-list at lists.ximian.com
>>>http://lists.ximian.com/mailman/listinfo/mono-list
>>>
>>> 
>>>
>>>      
>>>
>>_______________________________________________
>>Mono-list maillist  -  Mono-list at lists.ximian.com
>>http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>    
>>
>
>_______________________________________________
>Mono-list maillist  -  Mono-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
>
>_______________________________________________
>Mono-list maillist  -  Mono-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-list
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20061023/46eec27c/attachment.html 


More information about the Mono-list mailing list