Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi Friends,

I got the below issue,

i've referenced DLL from the project and added Using in the program to get the namespace.

But it's giving the issue saying "The type or namespace name XXX could not be found(are you missing using directive or an assembly reference?)"

Do i need to add anything in the App.Config file??

Please help me by providing solution to this, Thanks in advance.

Regards,
Srinivas
Posted
Updated 6-Mar-18 19:10pm

The Project which is is referencing the Assembly may have different framework type from the assembly.

for example:
Forms Project was set to ".Net Framework 4 Client Profile" if you change it to ".Net Framework 4", it should work fine.
 
Share this answer
 
Comments
Swapnil Girme 8-May-13 1:09am    
Thanks for your answer
[no name] 29-May-13 14:42pm    
How to change to .Net Framework 4. Please details ;)
harshil gandhi 1-Jul-15 2:57am    
thanks..... it worked for me.....@nouman 911
Pramod Sutar 29-Apr-17 6:37am    
It works for me for adding windows custom control reference issue..thanks
No.
Normally, just the reference and the using are enough - there is nothing else you should need to add.

Place the cursor in the name of the class you are trying to use. Does a small red line appear at the right hand side of the name?
If is does, hover the mouse over it and open the drop down when it appears. That will offer you options for solving the problem.

If it doesn't, does it appear at the left hand side?
If it does, hover the mouse again, and open the drop down. If this is basically "create the class" than the reference is not in properly - double check your references and the DLL / namespace for the class.

If all this fails, try a full re-build and see what happens.
 
Share this answer
 
I can only conclude that you haven't referenced all the correct DLLs as you don't need to anything else.

There are a few gotchas to be aware of

The same namespace can be used in multiple dll's.

If you have written a project (call it projectA) that calls system.web and then write another project (call it projectB) that references projectA, you will also need to add a reference to system.web in projectB too.
 
Share this answer
 
Comments
Srinivas39 16-Sep-11 6:09am    
I've refered all the DLLs, but getting the same :(
I copied an example of implementing image slide show from the internet and had the same problem. I got the refered error although in my case the code was not in App_Code folder. The code that was causing this error was in a folder that contained the user control. Because of the way compiler works the page with control was being compiled before the code of the control and so the referenced code could not be found resulting in error!

I therefore went to the folder with the control, right clicked the the control and chose the build page option thereby compiling the control code. Note the compiler does not recompile a code unless there has been changes in that code. Running the web site did not give the error.

Samuel Kamau
 
Share this answer
 
Comments
TheRealSteveJudge 26-Jan-15 7:32am    
You answered a very old question...
CHill60 26-Jan-15 7:45am    
See solution 1 from 3 years ago. A full rebuild would have solved this as OriginalGriff suggested
Open your project file with a text editor and verify that the RootNamespace element is correct as well as the AssemblyName element. I ran into this problem after renaming an existing project. Apparently Visual Studio doesn't handle such things very well.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900