Solved

Why asp.net can't find my namespace if I already added the reference dll to the project?

Posted on 2008-10-16
7
371 Views
Last Modified: 2012-08-14
I have a simple ASP.NET 3.5 project in c# to test out the code from
http://www.codeproject.com/KB/database/mysqlmembershipprovider.aspx
This code just uses a couple of files that require a reference to MySQL.

I already installed the MySQL data connector for .Net and already added the reference to that dll to my project.

I already created an "App_Code" folder to my project and placed both files in it.
Also tried changing the property "Build Action" of each file to "Compile".

Anyway, no matter what I do, I get the error below as if I did not have a reference to "MySQL.Data" which I definitely have.

Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 4:  using System;
Line 5:  using System.Data;
Line 6:  using MySql.Data.MySqlClient;



0
Comment
Question by:rudy2024
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:pr0t0c0l12
ID: 22734846
They mentioned in the description that the classes DOESN'T work with MySql.  They work with ODBC so you might want to use an Access database.
Hope this helps.
0
 
LVL 13

Accepted Solution

by:
TechTiger007 earned 50 total points
ID: 22734928
I hope that you have checked in "Reference" list  that MySql.Data entry is displayed.

This happened few times for me and it worked fine once I restarted visual studio.
Also try to copy the dll to bin folder of the application and try again
0
 

Author Comment

by:rudy2024
ID: 22735142
Thanks, I did have the "MySQL.Data" dll visible under my "References" listbox but anyway, I followed your advice and copied the file from GAC to my "Bin" folder and that took care of it.  Why ? I don't know.  Good thing is that it works!
Thank you.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 13

Expert Comment

by:TechTiger007
ID: 22735234
You may have clicked AcceptMultipleSolution button instead of Accept as Solution
0
 

Author Comment

by:rudy2024
ID: 22735330
Thanks I must have done that.
0
 

Author Closing Comment

by:rudy2024
ID: 31506894
Hopte this finally closes the solution.  Sorry for the trouble, it's first time I post a question.
0
 
LVL 13

Expert Comment

by:TechTiger007
ID: 22735362
You are welcome
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now