Читать книгу C# 24-Hour Trainer - Stephens Rod - Страница 17

Section I
The Visual Studio IDE and Controls
Lesson 1
Getting Started with the Visual Studio IDE
Copying Projects

Оглавление

Sometimes you may want to copy a project. For example, you might want to save the current version and then make a new one to try things out. Or you may want to give a copy of the project to a friend or your programming instructor so he or she can tell you why its New button makes the program exit.

You might look in Visual Studio's File menu and see the Copy As commands. Don't be tempted! Those commands copy single files, not the entire project. Later when you try to open one of those files, you'll discover that Visual Studio cannot find all of the other pieces that it needs and you'll be left with nothing usable.

To correctly copy a project, copy the entire solution or application folder and its directory hierarchy. Alternatively, you can compress the project directory and then copy the compressed file. Just be sure that whatever copying method you use brings along all of the project's files.

Note that you can delete the bin and obj subdirectories if you like to save space. Those directories contain files that Visual Studio creates when it loads and builds a program, and it will re-create them whenever it needs them later.

You can also delete the .vs directory, which contains user settings. Unfortunately that directory is hidden by default so it may be hard to find. To make File Explorer show you hidden files, open the Control Panel, click Appearance and Personalization, and select Folder Options. On the View tab, select Show Hidden Files and Folders, and then click OK. Now you can see the .vs directory to delete it.

NOTE

Compressing a project is very useful because it keeps all of its files together in a package. In particular, if you ever need to e-mail a project to someone (for example, if you e-mail me at RodStephens@CSharpHelper.com for help), you can remove the bin, obj, and .vs directories, compress the project folder, and e-mail the package as a single file.

If you're sending the project to your instructor as part of an assignment, rename the compressed file so it contains your name and the name of the assignment; for example, RodStephens6-1.zip.

C# 24-Hour Trainer

Подняться наверх