Creating ASP.NET Projects with Visual Studio .NET 2003

E

epigram

I've been creating some toy ASP.NET apps in an effort to understand the
technology. I've something odd with regards to project/solution creation.
If you create a new asp.net application, it appears that the project files
get created in the URL specified Location field on the New Project dialog
box. This makes sense to me. What is confusing is that the solution file
gets created in a folder with the same name as the location folder (the
virtual folder name), but that directory gets created in the directory
specified by the "Visual Studio projects location" field in the vstudio
settings.

Would someone explain to me why this is happening? I assume its desired
functionality, but I am not sure why I would want this disconnect between
the solution and the projects. I suppose this is trying to enforce some
best practices approach.

Also, how is this disconnect handled by SourceSafe version 6.0d? I'm sure
there is a nice article out there that explains all of this, I just couldn't
find it.

Any help would be much appreciated. Thanks!
 
G

Guest

Hi epigram ...
What you are seeing is by-design (as you might guess). The solution
file contains entries that point to the web project that is found at the
specified URL. Now ... why is this done? Because solutions can have more
than one project ... and only web projects need to be at a URL. This
provides one .sln file that is easier to locate (for example, in My
Documents\Visual Studio Projects) and can combine multiple types of project
(web, distribution, dll, more web, etc.) And SourceSafe handles this just
fine -- no problems. For an *exhaustive* discussion of Visual SourceSafe for
Web projects, see the Patterns & Practices guide at
http://msdn.microsoft.com/library/en-us/dnbda/html/Tdlg_rm.asp.
BTW: this changes in Visual Studio 2005. While VS 2005 still supports
URL-based web projects (a la VS .NET 2003), it will also support file-based
web projects ... these would appear in the file system with the solution.
 
K

Kevin Spencer

By default, Solution files as well as Project files are stored in My
Document\Visual Studio Projects. However, an ASP.Net application must reside
in a web server's virtual directories. Hence, ASP.Net projects are stored in
web server virtual directories, while other executable application projects,
and solutions, are still stored where they can be easily found. You don't
have to go looking through your Inetpub folder to find ASP.Net projects. You
just open the solution and it finds the projects for you.

As for the "disconnect" issue, well, Solutions are made up of multiple
projects. A Solution can be made up of many projects, Why? Because
well-designed assemblies can be used in multiple solutions. Therefore, it
makes sense to keep the solution file "disconnected" from any particular
project.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
E

epigram

Makes sense. Although, it doesn't appear that I can specifiy (on the fly)
where I'd like my solution to go. How would I handle this scenario:

We have a directory structure root where we like to keep all of our projects
& solutions (in various directories based upon project, product, etc. - as
is typical I believe). Let's call this c:\development. I want my If I
create an asp.net, but ultimately want all the project(s) and solution in
this structure, how would I achieve this? My approach, I suppose, would be
to first create a virtual directory that mapped to the development
subdirectory that I wanted the asp.net project to go. In order for me to
put my solution exactly where I want, I would have to go change the "Visual
Studio projects location" option (before I created the solution) to put the
solution where I wanted it to go. It seems for every asp.net
project/solution I create, I would have to go through this process. That
seems like a real pain. Is there a better way to achieve this or a
different best practices approach to this issue?

Thanks!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top