• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

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

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
rudy2024
Asked:
rudy2024
  • 3
  • 3
1 Solution
 
pr0t0c0l12Commented:
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
 
TechTiger007Commented:
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
 
rudy2024Author Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
TechTiger007Commented:
You may have clicked AcceptMultipleSolution button instead of Accept as Solution
0
 
rudy2024Author Commented:
Thanks I must have done that.
0
 
rudy2024Author Commented:
Hopte this finally closes the solution.  Sorry for the trouble, it's first time I post a question.
0
 
TechTiger007Commented:
You are welcome
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now