Solution file not in the solution folder

Discussion in 'ASP .Net' started by =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006.

  1. Why is it that when I create a new web application, the project folder
    containing the webform, web.config and csproj files appears in
    C:\inetpub\wwwroot, yet my .sln and .suo files appear in another folder in My
    Documents\Visual Studio Projects?

    Is this normal, or have I somehow made an inadvertant change somewhere?
     
    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Damien Guest

    cashdeskmac wrote:
    > Why is it that when I create a new web application, the project folder
    > containing the webform, web.config and csproj files appears in
    > C:\inetpub\wwwroot, yet my .sln and .suo files appear in another folder in My
    > Documents\Visual Studio Projects?
    >
    > Is this normal, or have I somehow made an inadvertant change somewhere?


    This is normal behaviour. Solution files are solution files. With all
    the extensibility in VS, solution files are designed to not know
    anything about the projects they might contain. So when VS comes to
    create a solution file, it creates it in the same place it creates any
    other solution files (by default).

    Now, some of the new project wizards let you dictate separate locations
    for the solutions directory and the project directory, but the new
    website wizard isn't one of them (at least under 2003, not sure about
    2005).

    Now, you might think that you could create a folder under
    c:\inetpub\wwwroot, create a blank solution under there, and then put
    the project in the same folder. But VS will complain that the folder
    exists...

    You could create the project and then move the solution file, and that
    should work fine. However, for larger jobs, you might have several
    non-web projects and a web project in the same solution (e.g. if you
    have a data layer DLL and a Business layer DLL). If that's the case, VS
    will be happiest if you have these other projects in sub folders below
    where your solution is located. Which if you've put the solution under
    the inetpub\wwwroot directory will considerably clutter that area (plus
    if you plan to XCopy deploy your project, not only are your code behind
    files sitting in a potentially web accessible location*, but so are
    your code files for your DLLs.

    *only if an administrator misconfigures IIS, to be sure, but why take
    the risk.

    Damien
     
    Damien, Sep 12, 2006
    #2
    1. Advertising

  3. Hi,

    cashdeskmac wrote:
    > Why is it that when I create a new web application, the project folder
    > containing the webform, web.config and csproj files appears in
    > C:\inetpub\wwwroot, yet my .sln and .suo files appear in another folder in My
    > Documents\Visual Studio Projects?
    >
    > Is this normal, or have I somehow made an inadvertant change somewhere?


    When you create a new solution, you can specify where the solution file
    must be saved. You can change the defaults under Tools / Options /
    Projects and solutions.

    I like to have the following structure:

    + Application/Library folder
    + _current
    - Solution File
    + Project 1 folder
    - Project file
    (+ Project 2 folder)
    (...)

    This allows me to make backups easier. However, in ASP.NET 1.1, you must
    manually create a virtual folder in IIS pointing to the corresponding
    project folder.

    You can also move the solution files around, and then open it again. In
    ASP.NET 2.0, if you save the web project to the file system, it will
    tell you that it doesn't find it anymore, but it's easy to use the
    properties (F4) to set the correct location again.

    HTH,
    Laurent
    --
    Laurent Bugnion, GalaSoft
    Software engineering: http://www.galasoft-LB.ch
    Private/Malaysia: http://mypage.bluewin.ch/lbugnion
    Support children in Calcutta: http://www.calcutta-espoir.ch
     
    Laurent Bugnion, Sep 12, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    3
    Views:
    2,969
    Alvin Bruney
    Oct 16, 2003
  2. William LaMartin

    _vti_cnf folder in the bin folder-- a problem?

    William LaMartin, Nov 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,719
    Oliver
    Nov 10, 2003
  3. Dan
    Replies:
    7
    Views:
    18,626
    catherine sea
    Oct 28, 2010
  4. =?Utf-8?B?SmVmZnJleQ==?=

    Different names for file folder and the solution/project

    =?Utf-8?B?SmVmZnJleQ==?=, Mar 23, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    419
    =?Utf-8?B?SmVmZnJleQ==?=
    Mar 23, 2007
  5. Replies:
    7
    Views:
    413
    Gabriel Genellina
    Sep 25, 2007
Loading...

Share This Page