<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Robert,<br>
You were correct the first time. I am trying to run an aspx file; I'm
not trying to any command line mono stuff (destop applications) only
aspx stuff with associated C# file that get compiled automatically.<br>
<br>
Dick<br>
<br>
Robert Jordan wrote:<br>
<blockquote type="cite" cite="midehj1h2$n4a$1@sea.gmane.org">
  <pre wrap="">Dick Steflik wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Robert,
Yes, I have and when I look in the GAC using gacutil it says that it is 
there. Was I supposed to do something with the -package option on the 
gacutil command when I put it onto the GAC (I followed the direction on 
the MySql site and your instructions)?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
I was pretty sure you're trying to run an aspx file, but now I have
the impression you're compiling from the command line.

If so, install the assembly using

        pkgconfig -package mysql -i MySql.Data

and compile using

        mcs -lib:/usr/lib/mono/MySql -r:MySql.Data ...

Replace /usr with your mono prefix.

Robert

  </pre>
  <blockquote type="cite">
    <pre wrap="">Dick

Robert Jordan wrote:

    </pre>
    <blockquote type="cite">
      <pre wrap="">Dick Steflik wrote:
 

      </pre>
      <blockquote type="cite">
        <pre wrap="">When I put the .dll (MtSql.Data.dll in ny application /bin directory, 
everything works OK ; but when I remove it and put the reference in 
web.config  (just like Robert said to the compiler can't find it.
  
        </pre>
      </blockquote>
      <pre wrap="">Did you install the assembly into the GAC as already told
a few times? :-)

Robert

 

      </pre>
      <blockquote type="cite">
        <pre wrap="">Dick Steflik
Binghamton University

Bradley, Peter wrote:

  
        </pre>
        <blockquote type="cite">
          <pre wrap="">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: <a class="moz-txt-link-abbreviated" href="mailto:mono-list-bounces@lists.ximian.com">mono-list-bounces@lists.ximian.com</a>
[<a class="moz-txt-link-freetext" href="mailto:mono-list-bounces@lists.ximian.com">mailto:mono-list-bounces@lists.ximian.com</a>] On Behalf Of Robert Jordan
Sent: 23 October 2006 15:40
To: <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
Subject: Re: [Mono-list] How do i tell Mono (for ASP.NET,C#) where to
find MySQL.Data.MySqlClient

Dick,

steflik wrote:


    
          </pre>
          <blockquote type="cite">
            <pre wrap="">Thanks for the patience but I got the same result. If the
 
      
            </pre>
          </blockquote>
          <pre wrap="">MySql.Data.dll 
    
          </pre>
          <blockquote type="cite">
            <pre wrap="">isn't in the /bin directory the compuiler can't find it. This may
 
      
            </pre>
          </blockquote>
          <pre wrap="">sound 
    
          </pre>
          <blockquote type="cite">
            <pre wrap="">stupid but what directory shoiuld the .dll be in?
 
      
            </pre>
          </blockquote>
          <pre wrap="">In the GAC (Global Assembly Cache), see (1) below.

Robert



    
          </pre>
          <blockquote type="cite">
            <pre wrap="">Thanks,

Dick Steflik
Binghamton University

Robert Jordan wrote:

 
      
            </pre>
            <blockquote type="cite">
              <pre wrap="">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":

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
&lt;system.web&gt;
  &lt;compilation debug="true"&gt;
    &lt;assemblies&gt;
      &lt;!-- insert *your* assembly name --&gt;
      &lt;add assembly="MySql.Data, Version=1.0.7.30073, 
Culture=neutral, PublicKeyToken=8e323390df8d9ed4" /&gt;
    &lt;/assemblies&gt;
  &lt;/compilation&gt;
&lt;/system.web&gt;
&lt;configuration&gt;

4) create a demo page "demo.aspx"

&lt;%@ Page %&gt;
&lt;%@ Import namespace="MySql.Data.MySqlClient" %&gt;
&lt;script runat="server"&gt;
void Page_Load (object sender, EventArgs e)
{
   // test whether we can create a dummy connection
      MySqlConnection con = new MySqlConnection ();
}
&lt;/script&gt;
&lt;html&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;


Robert
     
steflik wrote:


           
              </pre>
              <blockquote type="cite">
                <pre wrap="">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
               
                </pre>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">and 
    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <pre wrap="">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
               
                </pre>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">web 
    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <pre wrap="">programming here at the University and I really hate to have each of
               
                </pre>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">the 
    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <pre wrap="">students place the .dll in their /bin directory.

Dick Steflik
Binghamton University

Robert Jordan wrote:


               
                </pre>
                <blockquote type="cite">
                  <pre wrap="">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:
                     
                  </pre>
                  <blockquote type="cite">
                    <pre wrap="">Robert,
I'm new at this, where do I find the web.config file, I've been
                       
                    </pre>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">looking


    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <pre wrap="">around and it isn't obvious.  Also, my the impot that is failing
                       
                    </pre>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">is


    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <pre wrap="">"import MySql.Data.MySqlClient"; is that the assembly you 
are                             
                    </pre>
                  </blockquote>
                  <pre wrap="">referring to?
                     
                  </pre>
                  <blockquote type="cite">
                    <pre wrap="">Dick Steflik

Robert Jordan wrote:

                           
                    </pre>
                    <blockquote type="cite">
                      <pre wrap="">Dick Steflik wrote:


                                 
                      </pre>
                      <blockquote type="cite">
                        <pre wrap="">I can get Mono to build a command line program using MySql (and
                               
                        </pre>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">it


    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <blockquote type="cite">
                      <blockquote type="cite">
                        <pre wrap="">runs nicely)  but I have to tell the C# compiler where the dll
                               
                        </pre>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">is.


    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <blockquote type="cite">
                      <blockquote type="cite">
                        <pre wrap="">How do I do this for ASP.NET using C#.
I'm using Mono on FC5 with Apache and Mono 1.1.17....

                                       
                        </pre>
                      </blockquote>
                      <pre wrap="">Copy the MySql assembly into the bin folder of your ASP.NET app
or install the assembly into the GAC and specify the assembly
                           
                      </pre>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          <pre wrap="">name


    
          </pre>
          <blockquote type="cite">
            <blockquote type="cite">
              <blockquote type="cite">
                <blockquote type="cite">
                  <blockquote type="cite">
                    <blockquote type="cite">
                      <pre wrap="">in the web.config:

&lt;configuration&gt;
&lt;system.web&gt;
&lt;compilation&gt;
&lt;assemblies&gt;
&lt;add assembly="MySql.Data, Version=x.x.x.x, Culture=neutral,
PublicKeyToken=...."/&gt;
&lt;/assemblies&gt;
&lt;/compilation&gt;
&lt;/system.web&gt;
&lt;/configuration&gt;

You can obtain the full assembly name with

gacutil -l | grep MySql

Robert

_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>



                                 
                      </pre>
                    </blockquote>
                  </blockquote>
                  <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>



                     
                  </pre>
                </blockquote>
                <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>


               
                </pre>
              </blockquote>
              <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>



           
              </pre>
            </blockquote>
            <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>

 
      
            </pre>
          </blockquote>
          <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>

_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>



    
          </pre>
        </blockquote>
        <pre wrap="">------------------------------------------------------------------------

_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>
  
        </pre>
      </blockquote>
      <pre wrap="">_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>

 

      </pre>
    </blockquote>
    <pre wrap="">
------------------------------------------------------------------------

_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
Mono-list maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Mono-list@lists.ximian.com">Mono-list@lists.ximian.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ximian.com/mailman/listinfo/mono-list">http://lists.ximian.com/mailman/listinfo/mono-list</a>

  </pre>
</blockquote>
</body>
</html>