Bug #33020 MySQL Visual Studio plugin will not install.
Submitted: 5 Dec 2007 21:27 Modified: 26 Apr 2008 22:50
Reporter: Tom Dahlquist Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.1.4 OS:Microsoft Windows (XP Pro)
Assigned to: CPU Architecture:Any
Tags: installation, plugin, Visual Basic, Visual Studio

[5 Dec 2007 21:27] Tom Dahlquist
Description:
The Visual Studio plugin will not install on my computer.  I am on a very recent version of VS, 8.0.50727.42, and .NET, 2.0.50727.  I had Connector/NET 5.0.7 installed and so tried to install just the plugin, but it ended abnormally.  Visual Studio gets started up at some point during the installation process, but it exits abnormally saying that it encountered an unexpected condition, then the installation process backs out everything it had done.

I tried uninstalling Connector/NET 5.0.7 and installing 5.1.4, which now contains the plugin, but got the same results.

I hate working with SQL/Server and had hoped to run my client on MySQL, but that isn't going to happen if I can't get the plugin to install.

How to repeat:
It happens every time I try to install the plugin.
[5 Dec 2007 21:38] Tom Dahlquist
Sorry, my MySql version is 5.0.
[11 Dec 2007 18:03] Tonci Grgin
Tom, before we go any deeper try this:
 - Plug-ins (any) work only with VS Professional and up. They do not work with Express version.
 - Please use MS uninstall tools, Windows Install Clean Up. You can find it somewhere on MS downloads. You should make double sure prior versions of c/NET are uninstalled before proceeding.
[12 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[18 Jan 2008 22:05] Tom Dahlquist
Hi Tonci, thanks for your reply, sorry to take so long to get back--I was out to lunch for a few weeks.

I think I have covered everything you mentioned.  I am not on the Express version of VS.  I downloaded Windows Installer CleanUp, but as far as I can see I now have no version of Connector/NET on my system--I had to delete the 5.0.7 version before I could install the 5.1.4 version, but that didn't install, leaving me with no c/NET at all.

The only MySQl related software on my system is: MySQL Server 5.0; MySQL Tools for 5.0; and MySQL Tools for Visual Studio.

Tom
[5 Feb 2008 10:38] Tonci Grgin
Hi Tom and lol :-) I think nows the time to check Control Panel/Administrative Tools/Microsoft .NET Framework 2.0 Configuration and fix whatever problem it shows... Waiting on your feedback.
[6 Mar 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Mar 2008 20:29] Tom Dahlquist
Hello again, Tonci.  I see that my bug got suspended again, but I have a really good excuse this--I spent all of Feb in bed with the flu.

I checked the Microsoft .NET Framework but did not see anything I interpreted as a problem.  I am thinking of uninstalling and reinstalling VS, in the hope that might clear this up.

Tom
[12 Mar 2008 10:56] Tonci Grgin
Tom, probably the best way to do as I haven't seen problem myself nor in BugsDB (as of lately)...
[14 Mar 2008 17:50] Tom Dahlquist
Tonci, I uninstalled then reinstalled VS, but the effect of that was to change the nature of the problem.  Originally, the install process for Connector/NET was dying on me when it opened VS and encountered a problem.  That isn't happening now because it just isn't opening VS.  It was opening VS apparently to install the classes needed to actually access MySQL from VB.  I say that because none of those classes--all of the classes beginning with MySQL.--are installed on my system.  Connector/NET seems to be working as I can connect to MySQL via Server Explorer, but that isn't very useful since I have no way to connect from my VB programs.  I was wondering if the installer is looking for a path to VS--perhaps in the Registry?--and not finding it?  I say that because it seems like the installer is just bypassing that step. I hope you can think of something because this is incredibly frustrating and I'm about out of ideas.

Tom
[25 Mar 2008 18:29] Reggie Burnett
Tom

So the issue now is that when you go to add a reference to MySQL you don't see it listed in the Add References dialog?  I am not sure if you are aware but we currently do not ship any tool box items for the VS toolbox.
[26 Mar 2008 22:19] Tom Dahlquist
Hey Tonci,

I'm not talking about a toolbox item, I'm talking about the class definitions that make it possible to open a connection to MySQL in a program.  For example, I found the following in the MySQL 5.0 Reference manual section on using Connector/NET as the first line in establishing a connection:

Dim conn as New MySql.Data.MySqlClient.MySqlConnection

However, if I type this line into a VB program, Visual Studio doesn't recognize the reference because the MySql. namespace isn't defined on my system (as I can verify by using Object Browser).  That is what I believe the installation package was trying to do when it opened VS--install the contents of that namespace.

Tom
[4 Apr 2008 6:23] Tonci Grgin
Tom, I don't know what to say now...

Can you try out Reggie's and Jared's solutions in Bug#35565 and see if it helps?
[8 Apr 2008 20:14] Tom Dahlquist
Tonci,I was just looking through the installation docs in both the 5.0 and 5.1 reference menuals, and I found that someone has posted a comment to the manuals that seems to be the exact same problem I am facing.  He says that the installation process never completes on his servers and he has to manually copy the file MySql.Data.dll from where it gets installed to the /bin folder before it will work correctly.  That sounds exactly like my problem but doesn't help me much because I don't know where the /bin folder is supposed to be.  If you would like to read his note, it is at the very end of section 24.2.2.1 (5.0) or section 26.2.2.1 (5.1).
[9 Apr 2008 3:18] Tom Dahlquist
Hi guys, I had to add a new note because I realized that some of my original problem was due to misunderstanding, but now I have a new--and really weird--problem.

My first misunderstanding was thinking that "Visual Studio Plugin" was the library containing the classes that I needed to connect to MySql from my programs--I now realize that it is MySql.Data that has those.

I also realized that MySql.Data.dll is installed on my computer--I just didn't understand where it would be installed.

So everything should be OK now right?  Well no, because when I try to use the classes provided by this library, I get really weird results.

In Visual Studio, I added a reference to the MySql.Data library.  I know that it added OK because I can go into Object Browser and look up the classes in it, such as MySqlConnection.  I then typed in the following statement:

Dim conn As New MySqlConnection(connString)

This statement defines a variable named conn, of type MySqlConnedtion.  The VS editor accepts this statement, but then when I try to refer to the variable conn, the editor acts like it isn't defined!

This does seem to bear some relationship to the comment I mentioned in my last note in the reference manual.  I also wondered if you could look in your bugs database to see if there is anything like this revised bug.

Thanks,
Tom
[9 Apr 2008 6:54] Tonci Grgin
Tom, now I really don't know what to say or think now... Maybe you can check your machines GAC ("C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\mscorcfg.msc") from "Start / Control Panel / Administrative Tools / Microsoft .NET Framework 2.0 Configuration" and see if all is ok there. This definitely looks like some misconfiguration on your box.
[9 Apr 2008 14:22] Reggie Burnett
Tom

I'm now convinced that this is not a bug so I am marking it as such.  Considering your last report I think you are not including a proper imports line in your vb code.  You need to import the namespace like this:

Imports MySql.Data.MySqlClient

Public Class Form1
    Dim conn As MySqlConnection

End Class
[9 Apr 2008 16:17] Tom Dahlquist
Reggie, I don't think you actually read my last note because if you had, you wouldn't have been able to make your totally incorrect suggestion.

Of course I have the Imports line.  If I didn't, then the statement

Dim conn As New MySqlConnection(connString)

would itself generate an error message, but it doesn't!  But even though it doesn't, the editor thereafter acts as if the variable conn isn't defined. This behavior is totally inexplicable.  If the library wasn't available, then the Dim statement that defines the variable should give a message, not a following statement.

Also, did anyone bother to look at the note which is posted to the reference manuals, as that seems to describe a similar problem?

Tom
[9 Apr 2008 17:27] Reggie Burnett
Tom

Please accept my apologies.  I meant no offense by my comment.  I certainly did read your post but sometimes it is not clear what users mean by their comments.  For example, in your comment 'But even though it doesn't, the
editor thereafter acts as if the variable conn isn't defined' I do not know what you mean by 'the editor acts as if the variable isn't defined'.  Do you mean there are blue squiggles under the variable name?  What is the error given?  Even though the editor barfs, does the project compile?

Also, the plugin functionality has nothing to do with what you are describing.  the plugin functionality is only about connecting mysql to server explorer in Visual Studio. 

I did read the comment in the reference manual and do not understand it either.  The installation has nothing to do with anyone's bin folder.  The comment talked about having to manually copy the assembly over as evidence that the installer failed.  That is not so.  When you reference the assembly in your project then you can set the assembly to be copied to your bin folder or not (as in the case when you are using the assembly from the GAC).  The installer would have nothing to do with that.

I assume at this point that you are using the latest 5.1 connector/net release?
[26 Apr 2008 22:50] Tom Dahlquist
Reggie,

Sorry, I think I've been guilty of not being explicit enough--let me start over.  I typed in the following lines (which are pretty much taken verbatim from the Form1.vb sample program included):

Imports System
Imports System.Data
Imports MySql.Data.MySqlClient

Public Class TestMySql
    Dim conn As MySqlConection
    Dim connstr As String="..."
    conn = New MySqlConnection(connstr)   This statement shows the blue
                                          squiggle under the word 'conn'
End Class

So VB lets me define the variable 'conn' in the first Dim statement, but when I try to use the variable, I get an error.  The text of the error message is:

Declaration expected.

which seems to mean that the variable isn't declared, even though it is.

After I eventually located the MySql.Data.dll and added a reference to it and tried to use it, I ran into this problem.  I though it might be because the .dll was located outside of the Visual Studio folder, so I created a 'dummy' project and copied the .dll into the /Release folder, and changed my reference to point to there, but it didn't change anything.

This is so weird.  I can bring classes such as MySqlConnection up in the Object Browser and see all of their members just fine, but then I get these results when I try to use them.  My last shot is to wonder if there could any relation to the location of the .dll, although that now seems unlikely.

Thanks,
Tom
[16 Aug 2008 19:45] Muhamamd Kashif
I tried to installed Connector/Net 1.0.10.1 installed but during setup it through error "registration of the connector/Net core component failed" . It was because of GAC failure. Then i just register the gac then Add reference into my code then everything is working fine.