Customers having issues executing LegiTest tests in their build servers (TFS, Team City, etc.) because of missing dependencies can use the following steps to enable
Step 1: Locate your solution folder (the folder where you have stored your solution). If you are in Visual Studio, you can right click on the Solution node in the Solution Explorer and choose “Open Folder in File Explorer” from the context menu.
Step 2: Create a “Lib” folder at the same level as the Solution folder.
Step 3: Add the required DLLs into the “Lib” folder for the tests that you would like to include/run as part of the build process.
A) The list of DLLs are the assemblies that get added as references to the project when you save your .legitest file.
1. This list will be different depending on what actions / assets you are using.
2. You do not need the Microsoft.* Or System.* DLLs.
3. In my Example you would add the DotLiquid, log4net, Newtonsoft.Json, and any visible PragmaticWorks DLLs.
Example from Sample Test - References section.
4. You can find the location of these DLLs one of two ways – both described and outlined below:
Option 1 – The “bin\Release” or “bin\Debug” Folder
i. These assemblies are added to the “bin\Release” or “bin\Debug” folder within your Solution.
ii. Right above your test layout, look for the Configuration drop-down menu and verify if you are building in “Debug” or “Release”.
The example below shows I am building in “Debug” mode.
iii. Now go to the Solution Explorer.
iv. Right click on the Solution node and select “Open Folder in File Explorer” from the context menu. (this will open a new File Explorer window)
v. Open the “bin” folder.
vi. Based on step ii above open the “Debug” or “Release” folder.
vii. Refer to the list of DLLs from Step 3.A.2. Copy the DLLs from that list from the folder you just opened and add them to your “lib” folder from Step 2.
Option 2 – The Actual “Path”
i. Go to the Solution Explorer
ii. Expand the References and go find one of the assemblies.
iii. Right click and select “Properties” from the context menu (or hit F4) to display the properties of that assembly.
iv. Find the “Path” property – this will tell you exactly where the assembly is located.
v. Refer to the list of DLLs from Step 3.A.2, and copy the DLLs for EACH assembly based on the folder location listed in the “Path” property for each DLL. Add those, one by one, to your “lib” folder from Step 2.
Step 4: Open the .csproj file in the text editor of your choice (I use NotePad++ below) and scroll to the bottom. Locate the line that contains the following text:
<Import Project=”$(MSBuildToolsPath)\Microsoft.CSharp.targets” />.
Step 5: Insert/add the following three (3) lines shown below, directly below the <Import Project=”$(MSBuildToolsPath)\Microsoft.CSharp.targets” /> line.
Example of what the final result should look like:
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Step 6: Save the .csproj file.
Step 7: If the project was open in Visual Studio while performing this edit, you will be prompted to reload the project when you return to the Visual Studio window.
You should now be able to successfully run your build that includes your LegiTest assemblies.