Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have class and save all it
for reuse it in new class i add it ( debug/BankLib.exe) to reference and using it's namespace....
but it has error that can not find the namespace!!!!!!
"
VB
Error   1   The type or namespace name 'BankLib' could not be found (are you missing a using directive or an assembly reference?)   D:\Users\Roham\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs   10  7   WindowsFormsApplication1
"

what do i do with this error?
Posted
Comments
Toli Cuturicu 2-Sep-10 7:30am    
Reason for my vote of 1
very poor question

I am not sure whether I understood your question properly. I am assuming the following:

1. You have a class that you've used in a Console application project.
2. You now want to reuse the class in another project (A windows forms project) and for that you added a reference to the Console application project.
3. You are getting the above error you mentioned.

If the assumptions are correct, you need to put the Class in a Class library project, make sure it builds and then add a reference to that class library in your windows forms project (You cannot add a reference to a console project and use a class from that project).

Also, you need to import namespace of that class where you are trying to use that class.
 
Share this answer
 
v2
Comments
roham_06 1-Sep-10 5:01am    
I have class that have 4 textbox
i wanna reuse it for another class and add to form 2 button for save texboxes and exit !
Al-Farooque Shubho 1-Sep-10 5:08am    
I guess you can't do that (Re-using a Form.cs class in another Form.cs class), though I am not a Windows Forms expert.
Hi,

Your question is not clear.

My understanding is that, you have written a class (*.cs or *.vb) with function and variables and you want to use them in another project.

If so, open your new project in Visual studio IDE and do the following,
Project -> Add Existing Item. and then browse the class file and add it in your project.

Regards,
Suresh
 
Share this answer
 
Comments
roham_06 1-Sep-10 5:05am    
] want to reuse a project ! with a refrences
For reusing a class you have to build the class to a dll. For that create a class library ,build it and refer the dll in another class. Use the namesapce of the referrer class. Create a object of the class and all the methods with access specifier public in referrer class will be available in current class.
 
Share this answer
 

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