Visual Studio中项目的最佳默认位置是什么?

时间:2022-09-01 08:12:08

Over the years I have vacillated between having my project/source folders in a directory one level removed from the root (e.g. D:\Projects) and keeping them in the default location for Visual Studio.

多年来,我一直在将我的项目/源文件夹放在从根目录中删除一级目录(例如D:\ Projects)并将它们保存在Visual Studio的默认位置之间摇摆不定。

In the past, I resisted storing anything in the various "My Documents" folders established by Win 95, Win 98, and XP. I finally switched to storing them in the Documents folder since Vista shortened the path and I got tired of changing default directories for my dev tools. However, now I find myself leaning toward creating a folder off root again since I am setting up a new machine.

在过去,我拒绝在Win 95,Win 98和XP建立的各种“我的文档”文件夹中存储任何内容。我终于切换到将它们存储在Documents文件夹中,因为Vista缩短了路径,我厌倦了更改我的开发工具的默认目录。但是,现在我发现自己倾向于再次创建一个root文件夹,因为我正在设置一台新机器。

I get tired of the long paths you have to navigate to when stuff is stored in the documents folders. Also, I don't backup source code and database files like I do with my other documents since I use a VCS for source code. However, it seems you are always fighting to maintain a "non-standard" source location since every dev tool generally wants to store stuff in a subfolder of documents.

当东西存储在文档文件夹中时,我厌倦了必须导航到的长路径。此外,我不像我使用其他文档那样备份源代码和数据库文件,因为我使用VCS作为源代码。但是,您似乎总是在努力维护“非标准”源位置,因为每个开发工具通常都希望将内容存储在文档的子文件夹中。

I would like to hear other's opinions on this subject.

我想听听其他人对这个问题的看法。

9 个解决方案

#1


I think it depends on your use... I prefer to have my development projects on a separate drive/partition, so will usually use the following convention D:\projects\{company-name}\({client-name}|internal)\{project-name} Where the client-name comes into play is when the work is by a given company, but for another. I keep my projects under D:\projects\personal\... This allows for a better structure.

我认为这取决于您的使用...我更喜欢将我的开发项目放在一个单独的驱动器/分区上,因此通常会使用以下约定D:\ projects \ {company-name} \({client-name} | internal )\ {project-name}客户端名称发挥作用的时间是指某个公司的工作,而另一个公司的工作。我将我的项目保存在D:\ projects \ personal \ ...下,这样可以实现更好的结构。

As to backup strategies, imho this is what source control is for. I prefer subversion, and have a backup strategy for the svn server. Although I didn't much care for ankh 1.x, the 2.x version, along with TortoiseSVN have worked pretty well for me. As a matter of practice, I tend to checkin often, and try to only checkin code in a runnable state (though new features/code may not work).

至于备份策略,imho这就是源代码控制的目的。我更喜欢subversion,并为svn服务器提供备份策略。虽然我不太关心ankh 1.x,但2.x版本和TortoiseSVN对我来说效果很好。实际上,我倾向于经常检查,并尝试仅在可运行状态下签入代码(尽管新功能/代码可能不起作用)。

#2


In clear violation of my Unix past I use c:\dev (for development) or whatever other drive I use for development. Note: It is advisable NOT to use the system partition for development as software development really fragments the disk.

明显违反我的Unix过去,我使用c:\​​ dev(用于开发)或我用于开发的任何其他驱动器。注意:建议不要使用系统分区进行开发,因为软件开发确实会破坏磁盘。

I never had any reason to use another directory - except for some projects where "company standards" forced everybody to have the development directory on the root of the C: drive. (really! They had hardcoded paths to c:\whatever)

我从来没有任何理由使用另一个目录 - 除了一些项目,其中“公司标准”强迫每个人在C:驱动器的根目录上拥有开发目录。 (真的!他们有硬编码的路径到c:\ whatever)

During development I sometimes check out multiple versions of the source to different directoies - if only to find out that the version committed into the version control system of the day really has every file checked in. (Sometimes I add a file to the development directory but forget to check it in.)

在开发过程中,我有时会将源的多个版本检查到不同的版本 - 如果只是为了发现当前版本控制系统中提交的版本确实已经签入了每个文件。(有时我将文件添加到开发目录但是忘记检查。)

So I think it is rather irrelevant where your development directory is, as long as the path is typable for you (I prefer short paths) and does not contain white space for the usual reasons on windows (if you want to do some scripting).

所以我认为你的开发目录在哪里是相当无关紧要的,只要路径对你来说是典型的(我更喜欢短路径)并且由于Windows上的通常原因而不包含空格(如果你想做一些脚本)。

#3


I preferred location at another partition. Because projects have many and many small files and if you use SVN or other revision control system this files have very high fragmentation and slowing system if are storing at OS partition.

我更喜欢在另一个分区的位置。因为项目有很多很小的文件,如果你使用SVN或其他版本控制系统,如果存储在操作系统分区,这些文件会有很高的碎片和速度慢的系统。

#4


I haven’t tried it myself, but I guess you can put your projects in My Documents and use a symbolic link to the directory in your root folder. By doing that you can access your files both ways and solve problems like changing directory for tools. Info about symbolic links in Vista

我自己没有尝试过,但我想你可以将你的项目放在我的文档中,并使用指向根文件夹目录的符号链接。通过这样做,您可以双向访问文件并解决更改工具目录等问题。有关Vista中符号链接的信息

If you’re the only one using your computer I don’t really see why you should put your code in the profile directory, backup should be done using a version control system anyway.

如果您是唯一使用计算机的人,我真的不明白为什么要将您的代码放在配置文件目录中,无论如何应该使用版本控制系统进行备份。

#5


I store "active" projects on a secondary drive, one level from the root. It's much more easy to get quickly to that folder (even if VS2008 has this nice "Open Folder in windows explorer" now). It's also convenient for backups, format/reinstall, etc. The "less active" projects are stored on a NAS for quick reference. All are also stored on a remote SVN server that is backuped. (I'd also recommend not using # in folder for web application as it (sometimes) create strange errors from the development web server)

我将“活动”项目存储在辅助驱动器上,从根目录开始。快速获取该文件夹要容易得多(即使VS2008现在在Windows资源管理器中有这么好的“打开文件夹”)。它还可以方便地进行备份,格式化/重新安装等。“不太活跃”的项目存储在NAS上以供快速参考。所有这些都存储在备份的远程SVN服务器上。 (我还建议不要在文件夹中使用#,因为它(有时)从开发Web服务器创建奇怪的错误)

#6


I use SUBST (run on startup) to map some random folder to a high-lettered drive. Then I can put my stuff anywhere, and move it around, and yet I always get to refer to it by Y: or Q: or whatever.

我使用SUBST(在启动时运行)将一些随机文件夹映射到高字母驱动器。然后我可以将我的东西放在任何地方,并移动它,但我总是通过Y:或Q:或其他来引用它。

This is one of those extra layers of indirection that are said to solve every problem.

这是解决每个问题的额外间接层之一。

#7


For personal projects I just put them on the desktop (although I do move the desktop to D:\Desktop). They are archived off to my documents when they become inactive.

对于个人项目,我只是将它们放在桌面上(尽管我将桌面移动到D:\ Desktop)。当它们变为非活动状态时,它们将存档到我的文档中。

For work I have all the projects in a C:\Sourcecode folder inside a dedicated development virtual machine.

为了工作,我将所有项目都放在专用开发虚拟机内的C:\ Sourcecode文件夹中。

#8


Just one question, do your primarily develop desktop apps or web apps?

只有一个问题,您主要开发桌面应用程序或Web应用程序吗?

If you are constantly writing web apps, here's what works for me:

如果您经常编写Web应用程序,这对我有用:

  1. Create a folder: c:\dev or c:\sites (keep it simple)
  2. 创建一个文件夹:c:\ dev或c:\ sites(保持简单)

  3. Register the folder as a virtual directory in IIS
  4. 将该文件夹注册为IIS中的虚拟目录

  5. Create a different folder for each of your projects and create a web application in IIS for each of them
  6. 为每个项目创建一个不同的文件夹,并在IIS中为每个项目创建一个Web应用程序

One advantage this setup might have is that, its easier for you to navigate your site in the browser, i.e less typing, easier to remember, standardization for all your other apps.

此设置可能具有的一个优点是,您可以更轻松地在浏览器中浏览您的网站,即更少打字,更容易记住,所有其他应用程序的标准化。

my 2cents.

#9


it is better to keep your project in the other partition else than window and i think as i do d:\projects\"some grouping of project own your own choice"\projectname

最好将你的项目保留在除窗口之外的其他分区中,我认为正如我所做的那样d:\ projects \“一些项目分组拥有你自己的选择”\ projectname

e.g. d:\projects\UNIversty\admission d:\projects\universry\examination d:\projects\planners\ipp

例如d:\ projects \ UNIversty \ admission d:\ projects \ universry \ examination d:\ projects \ planners \ ipp

#1


I think it depends on your use... I prefer to have my development projects on a separate drive/partition, so will usually use the following convention D:\projects\{company-name}\({client-name}|internal)\{project-name} Where the client-name comes into play is when the work is by a given company, but for another. I keep my projects under D:\projects\personal\... This allows for a better structure.

我认为这取决于您的使用...我更喜欢将我的开发项目放在一个单独的驱动器/分区上,因此通常会使用以下约定D:\ projects \ {company-name} \({client-name} | internal )\ {project-name}客户端名称发挥作用的时间是指某个公司的工作,而另一个公司的工作。我将我的项目保存在D:\ projects \ personal \ ...下,这样可以实现更好的结构。

As to backup strategies, imho this is what source control is for. I prefer subversion, and have a backup strategy for the svn server. Although I didn't much care for ankh 1.x, the 2.x version, along with TortoiseSVN have worked pretty well for me. As a matter of practice, I tend to checkin often, and try to only checkin code in a runnable state (though new features/code may not work).

至于备份策略,imho这就是源代码控制的目的。我更喜欢subversion,并为svn服务器提供备份策略。虽然我不太关心ankh 1.x,但2.x版本和TortoiseSVN对我来说效果很好。实际上,我倾向于经常检查,并尝试仅在可运行状态下签入代码(尽管新功能/代码可能不起作用)。

#2


In clear violation of my Unix past I use c:\dev (for development) or whatever other drive I use for development. Note: It is advisable NOT to use the system partition for development as software development really fragments the disk.

明显违反我的Unix过去,我使用c:\​​ dev(用于开发)或我用于开发的任何其他驱动器。注意:建议不要使用系统分区进行开发,因为软件开发确实会破坏磁盘。

I never had any reason to use another directory - except for some projects where "company standards" forced everybody to have the development directory on the root of the C: drive. (really! They had hardcoded paths to c:\whatever)

我从来没有任何理由使用另一个目录 - 除了一些项目,其中“公司标准”强迫每个人在C:驱动器的根目录上拥有开发目录。 (真的!他们有硬编码的路径到c:\ whatever)

During development I sometimes check out multiple versions of the source to different directoies - if only to find out that the version committed into the version control system of the day really has every file checked in. (Sometimes I add a file to the development directory but forget to check it in.)

在开发过程中,我有时会将源的多个版本检查到不同的版本 - 如果只是为了发现当前版本控制系统中提交的版本确实已经签入了每个文件。(有时我将文件添加到开发目录但是忘记检查。)

So I think it is rather irrelevant where your development directory is, as long as the path is typable for you (I prefer short paths) and does not contain white space for the usual reasons on windows (if you want to do some scripting).

所以我认为你的开发目录在哪里是相当无关紧要的,只要路径对你来说是典型的(我更喜欢短路径)并且由于Windows上的通常原因而不包含空格(如果你想做一些脚本)。

#3


I preferred location at another partition. Because projects have many and many small files and if you use SVN or other revision control system this files have very high fragmentation and slowing system if are storing at OS partition.

我更喜欢在另一个分区的位置。因为项目有很多很小的文件,如果你使用SVN或其他版本控制系统,如果存储在操作系统分区,这些文件会有很高的碎片和速度慢的系统。

#4


I haven’t tried it myself, but I guess you can put your projects in My Documents and use a symbolic link to the directory in your root folder. By doing that you can access your files both ways and solve problems like changing directory for tools. Info about symbolic links in Vista

我自己没有尝试过,但我想你可以将你的项目放在我的文档中,并使用指向根文件夹目录的符号链接。通过这样做,您可以双向访问文件并解决更改工具目录等问题。有关Vista中符号链接的信息

If you’re the only one using your computer I don’t really see why you should put your code in the profile directory, backup should be done using a version control system anyway.

如果您是唯一使用计算机的人,我真的不明白为什么要将您的代码放在配置文件目录中,无论如何应该使用版本控制系统进行备份。

#5


I store "active" projects on a secondary drive, one level from the root. It's much more easy to get quickly to that folder (even if VS2008 has this nice "Open Folder in windows explorer" now). It's also convenient for backups, format/reinstall, etc. The "less active" projects are stored on a NAS for quick reference. All are also stored on a remote SVN server that is backuped. (I'd also recommend not using # in folder for web application as it (sometimes) create strange errors from the development web server)

我将“活动”项目存储在辅助驱动器上,从根目录开始。快速获取该文件夹要容易得多(即使VS2008现在在Windows资源管理器中有这么好的“打开文件夹”)。它还可以方便地进行备份,格式化/重新安装等。“不太活跃”的项目存储在NAS上以供快速参考。所有这些都存储在备份的远程SVN服务器上。 (我还建议不要在文件夹中使用#,因为它(有时)从开发Web服务器创建奇怪的错误)

#6


I use SUBST (run on startup) to map some random folder to a high-lettered drive. Then I can put my stuff anywhere, and move it around, and yet I always get to refer to it by Y: or Q: or whatever.

我使用SUBST(在启动时运行)将一些随机文件夹映射到高字母驱动器。然后我可以将我的东西放在任何地方,并移动它,但我总是通过Y:或Q:或其他来引用它。

This is one of those extra layers of indirection that are said to solve every problem.

这是解决每个问题的额外间接层之一。

#7


For personal projects I just put them on the desktop (although I do move the desktop to D:\Desktop). They are archived off to my documents when they become inactive.

对于个人项目,我只是将它们放在桌面上(尽管我将桌面移动到D:\ Desktop)。当它们变为非活动状态时,它们将存档到我的文档中。

For work I have all the projects in a C:\Sourcecode folder inside a dedicated development virtual machine.

为了工作,我将所有项目都放在专用开发虚拟机内的C:\ Sourcecode文件夹中。

#8


Just one question, do your primarily develop desktop apps or web apps?

只有一个问题,您主要开发桌面应用程序或Web应用程序吗?

If you are constantly writing web apps, here's what works for me:

如果您经常编写Web应用程序,这对我有用:

  1. Create a folder: c:\dev or c:\sites (keep it simple)
  2. 创建一个文件夹:c:\ dev或c:\ sites(保持简单)

  3. Register the folder as a virtual directory in IIS
  4. 将该文件夹注册为IIS中的虚拟目录

  5. Create a different folder for each of your projects and create a web application in IIS for each of them
  6. 为每个项目创建一个不同的文件夹,并在IIS中为每个项目创建一个Web应用程序

One advantage this setup might have is that, its easier for you to navigate your site in the browser, i.e less typing, easier to remember, standardization for all your other apps.

此设置可能具有的一个优点是,您可以更轻松地在浏览器中浏览您的网站,即更少打字,更容易记住,所有其他应用程序的标准化。

my 2cents.

#9


it is better to keep your project in the other partition else than window and i think as i do d:\projects\"some grouping of project own your own choice"\projectname

最好将你的项目保留在除窗口之外的其他分区中,我认为正如我所做的那样d:\ projects \“一些项目分组拥有你自己的选择”\ projectname

e.g. d:\projects\UNIversty\admission d:\projects\universry\examination d:\projects\planners\ipp

例如d:\ projects \ UNIversty \ admission d:\ projects \ universry \ examination d:\ projects \ planners \ ipp