file locations

Posted on 2006-03-20
Last Modified: 2010-04-16
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!!!
Question by:ARACK04
    LVL 52

    Assisted Solution

    by:Carl Tawn
    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.

    Author Comment

    What if I were programming on the command line (or writing a code generator)

    Author Comment

    points added
    LVL 96

    Accepted Solution

    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.


    Author Comment

    Thanks.  Nice user name :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now