cashdeskmac said:
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