We now want to update our project by adding an existing library file, and want to organize this file under a new folder. To create a new sub-folder at the project level, right-click the project node (#1 from image below) and select Add -> New Folder from the context menu (#2 and #3 from the image below).
This will create a new sub-folder called NewFolder1 under the project and will automatically prompt you to rename the folder with a more appropriate name. Change the name from "NewFolder1" to "My New Folder" and press the Enter key.
Tip: If you accidentally cancel the folder rename operation, right-click on the folder and select Rename from the context menu to give it the proper name.
Note: Remember that folders in Solution Explorer exist on the file system. When renaming a folder, but sure you do not include illegal path characters in the name and that the name is unique. If you still have Windows Explorer open, you will see the new folder created.
Now we want to add an existing file to our new folder. Right-click on My New Folder (#1 in the image below) and select Add -> Add Existing Item... from the context menu (#2 and #3 from the image below).
You will be prompted with the Add Existing Item dialog.
In the Folders tree on the left, browse to and select the folder
C:\Program Files (x86)\Patterson Consulting\Test Design Studio\Original Samples\Libraries (note the folder path differs on a 32-bit operating system). Once selected, a list of files in that folder will be displayed on the right. Locate and select
the Saffron4Web.qfl file (#1 in the image above), but do not click the Add button yet. Notice that the Add button has a drop-down arrow on the right side of the button. Click that arrow to display your "Add" options (#2 in the image above, magnified for clarity).
By default, the "Add" operation will copy the selected file from its original location to your project folder. This is used to maintain the organization of all your project assets under a single root folder. If you prefer, you may link to the existing file instead of copying it under your project. You do this by selecting the Add As Link option. Linking to files is not recommended for key testing assets such as tests, libraries, or object repositories. Linking, however, can be very useful for creating links to documentation or other files that are useful for your project but should remain outside the project's underlying folder structure.
Tip: For files that are used by multiple projects such as shared libraries, you may be tempted to link to that file from all the projects that need it. While this will work, the preferred method is to either create a reference to the shared file or create a second project in the solution to contain those shared assets. Those features will be discussed later.
Warning: You should never directly add a shared file to a project as this will create multiple copies of the same file. You should use linking, references, or secondary projects instead.
In this case, we want to directly add the file. To do this, simply click the Add button or select the Add option from the drop-down list (#3 in the image above). You will now see a copy of the Saffron4Web.qfl file added directly under the My New Folder folder, and the original file is left unmodified.