This version of the Ed-Fi ODS / API is no longer supported. See the Ed-Fi Technology Version Index for a link to the latest version.
Step 4. Prepare the Development Environment
- Benjamin Meyers
- Julie Remde
To prepare the development environment, you'll need to follow the procedures described below:
Configure MSBuild
Because packages compiled from some of the projects are used during the code generation of later projects, there is a potential for earlier packages to be locked if the solution is recompiled in rapid succession. This is due to the way that MSBuild caches build processes to minimize compile time by default. Build processes are normally held for reuse for approximately 10 minutes.
To turn off this default behavior when compiling in Visual Studio, the "MSBuildDisableNodeReuse" variable must be set. There are two options for setting this variable:
Both options instruct the compiler to create a new process for each build job. As a side effect, this action also releases any resources that may be held by inactive compiler processes.
If these settings are not applied, Visual Studio or MSBuild may lock resources during build. Restarting Visual Studio (or the command prompt session) will resolve the problem for the first build after the restart. Waiting for up to 15 minutes between builds will also achieve this.
The options for setting this variable are described below.
Option 1: Set "MSBuildDisableNodeReuse" Globally
To set the "MSBuildDisableNodeReuse" variable globally:
- Press the Windows key on your keyboard, type Environment Variables, select Edit the system environment variables, and press Enter. This brings up System Properties. Under Advanced, select Environment Variables.
Alternately, right-click the Start Menu, select System, and click on the Advanced system settings. Under Advanced, select Environment Variables. - Under User variables, Select New...
- For Variable name, enter MSBuildDisableNodeReuse
- For Variable value, enter 1, and press OK.
To turn off this behavior when compiling the solution using MSBuild, include the following compiler flag: /nr:false
Option 2: Set "MSBuildDisableNodeReuse" per Command Prompt Session
If the "MSBuildDisableNodeReuse" variable is set within a command prompt session, the Visual Studio development environment must be launched using the devenv command (rather than from an icon):
SET MSBUILDDISABLENODEREUSE=1
Verify PowerShell Script Permissions
It is important that when opening PowerShell, Run as Administrator is selected.
You may need to change the execution policy for unsigned PowerShell scripts to run on your machine to run the scripts.
This may be accomplished by opening a PowerShell console and typing the following command:
Set-ExecutionPolicy Unrestricted
Initialize PowerShell Scripts for Development
There are several databases that must be successfully deployed. PowerShell scripts that initialize all necessary development databases are included in the Visual Studio solution. These scripts are enabled for use within Visual Studio when the Ed-Fi-ODS solution is opened. They may also be loaded for use within a PowerShell console window by running the initialize PowerShell for development script located at:
C:\Ed-Fi-ODS-Implementation\Initialize-PowershellForDevelopment.ps1
If you are in the C:\Ed-Fi-ODS-Implementation directory, PowerShell will auto-complete the script for you if you type init and then press Tab.
In either case, when the scripts are loaded, you should see the results shown below:
Initialize the Development Environment
This command creates databases, generates code templates, and compiles projects in the solution.
Once the PowerShell scripts for development has been loaded and a development certificate has been installed, the development environment may be initialized by typing the following into a PowerShell command prompt:
initdev
Some considerations while running the script:
- The
initdev
script may not finish with a command prompt when it is automatically loaded with the solution in Visual Studio in some circumstances. Simply press Enter and ignore any messages that appear in the console window. - Initializing the development environment will take several minutes to complete. Some developers report encountering an error during the initialization process the first time it is run. This is due to an intermittent timing issue. The issue generally resolves itself when the
initdev
process is run a second time.
A successful initdev
execution will display the tasks executed and their duration as shown below: