Click here to Skip to main content
15,912,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
is it possible to create my own namespaces to use in other projects, so i can use their functions in other projects?
Posted

1 solution

Have you tried this?
C#
namespace MyCompany.MyProject.MyFunctionBlock
{ 
   ...
}

Cheers
Andi
 
Share this answer
 
Comments
brucey_D 28-Oct-13 14:03pm    
yes, but doesnt that just create the namespace in the current project? I want to write my own functions in my own namespace that i can use in any of my other projects?
Andreas Gieriet 28-Oct-13 14:36pm    
Yes, one that you can use in the other projects. In the other projects, add a reference to your current assembly, add a using namespace MyCompany.MyProject.MyFunctionBlock;. Then you can use in the other project your types and functions from this project directly (i.e. unqualified).
You may alse leave away the using namespace... clause. In that case, you must refer fully qualified to the entities from your current project, e.g. MyCompany.MyProject.MyFunctionBlock.MyFunction(...);.
Cheers
Andi
brucey_D 28-Oct-13 14:54pm    
Got it, thank you!
thatraja 28-Oct-13 15:23pm    
5!
Andreas Gieriet 30-Oct-13 11:57am    
Thanks for your 5!
Cheers
Andi

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