[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

file locations

I have a quick question on file locations in C# - ie the physical location where you store your sourcecode.  In java the location of your file was dictated by the namespace which contained them.  In C# though, the namespace has nothing to do with file location.  So, if I wanted to store some of my source files in a different directory, how would I go about doing that?  

Would I have to compile them to a dll?

Thanks much!!!
0
ARACK04
Asked:
ARACK04
  • 3
2 Solutions
 
Carl TawnSystems and Integration DeveloperCommented:
By "different directory" do you mean a sub directory underneath the project, or a different location entirely ?

Storing the in subdirectories is straight forward. Just right-click on your Solution in the project browser and select "Add New Folder". This will create a new folder underneath your root project folder. Any files you put in here will be included in your compile.

I'm not sure if its possible to store files for your project in folders outside of the project folder.
0
 
ARACK04Author Commented:
What if I were programming on the command line (or writing a code generator)
0
 
ARACK04Author Commented:
points added
0
 
Bob LearnedCommented:
Yeah, C# natively doesn't like code in a single project to be distributed across multiple folders, unless they are sub-folders to the main project AFAIK.  Putting code into DLL's is certainly one way around that.

Bob
0
 
ARACK04Author Commented:
Thanks.  Nice user name :)
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

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