Benefits of Using Visual Studio Projects

Micro Focus recommends that you create and use Visual Studio projects for your source code. There is a number of benefits to using projects such as:

The following sections include some recommendations about how to create and configure your projects, especially when you are working with a large number of files.

Structuring your projects and solutions

The following list gives a number of recommendations for how to structure your projects and solutions, especially if your applications consist of a large number of files:

Recommendation Benefits
Create multiple smaller projects in a solution, rather than keeping all code in one very big project. Consider creating one project per functional area of your application.

Smaller projects are:

  • easier to manage
  • quicker to load into the IDE
  • quicker to compile

In addition, keeping your projects smaller helps achieve quicker response times in the editor.

Consider splitting a very large solution into multiple solutions, especially if the solution contains many projects.

In addition to the reasons listed above, this helps with some solution-specific issues such as using Find All References for a solution. If your solution contains hundreds of projects, using this feature can have a negative effect on performance.

Do not include copybooks in your projects. Store them in a folder outside the project folder. You then specify the location of the copybooks on the Copybook Paths page in the project's properties.
  • Helps improve the performance as this means the IDE does not have to process the copybooks and resolve the file dependencies.
  • Helps keep the project size smaller.
Use paths relative to the project location in the project's properties - for example, for paths for the build output or for the location of copybook. Helps make the project portable to other machines.
Do not use copybooks or any other files from a network drive. Helps avoid any issues with performance.

Limit the number of files stored in a single project

Micro Focus recommends that you:

  • Avoid having a large number of files in a project. Consider adding multiple smaller projects in your solution and avoid using one single project for all the source files.
  • Consider creating a project per functional area of your application.

It is hard to provide a strict recommendation for the maximum number of files to store in a single project. This number will depend on many factors related to your particular development scenario such as:

  • Size of the files and of the programs
  • Number and size of any copybooks
  • Number of people working on the same project
  • Whether the project is a managed or a native one
  • Whether your applications use incremental linking
  • The existing structure of the source code

Keeping the size of your projects smaller helps avoid various performance issues. As the size of a project increases you need to be aware of issues such as the following::

  • The poorer the user experience inside Visual Studio
  • Find All References works slower
  • The project is more difficult to manage
  • The longer the times to load and rebuild the project
  • The longer the times to perform background syntax checking, code analysis, or to scan files for Compiler directives (using Determine Directives).

Limit the number of projects in a solution

Micro Focus recommends that you avoid having a large number of projects in a single solution. The reasons are the same as the ones for limiting the number of files within a single project.

It is hard to provide a strict recommendation for the maximum number of projects to store in a solution. Keeping the size of your solutions smaller helps avoid various performance issues and improves the times for:

  • Loading the projects in the solution
  • Rebuilding the solution
  • Performing background syntax checking
  • Resolving any references
  • Scanning files for Compiler directives (using Determine Directives)

Micro Focus makes the following recommendations when working with copybooks:

Recommendation Benefits
Do not include any copybooks directly in your project. Store them in a folder outside the project's location and add that folder to the Copybooks page in the projects' properties. This helps reduce the projects' sizes and makes projects easier to manage.

This also helps share the copybooks if other projects depend on them.

Avoid adding hardcoded paths to the copybooks in your source files or using the copybooks from the projects folder. Do not use other similar methods such as setting an environment variable to point to the files. Instead, use relative paths when specifying the location of the copybooks on the Copybooks page in the projects' properties. This helps make the projects portable. You can use the relative path with the MSBuild utility and any build scripts.