Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 19 Next »

The SeaLights .NET agent can be integrated with MSBuild to scan the binary code and provide the SeaLights server the build information.

Generating a session ID

Before running the build scan and tests, you need to create a session ID. The session ID is provided to each step in order link them together as one complete cycle

Sample command
SL.DotNet.exe config --appName "myApp" --branchName "master" --buildName "1" --includeNamespace myNameSpace.* --buildSessionIdFile buildSessionId.txt

Automatic setup

TheSeaLights agent can automatically setup your msbuild to work with the SeaLights agent.

SL.DotNet.exe prepareForMsBuild --buildSessionIdFile buildSessionId.txt --workspacePath "C:\path\to\project" --baseDir  "C:\path\to\project" --ignoreGeneratedCode true --logEnabled true

This creates a file called 'after.{SOLUTION_FILE_NAME}.targets' which sits alongside your solution file with all the needed parameters in it for.

Run MSbuild

When running MSBuild, it will identify the above file and cause our agent come up and report the details needed from the binary files.

Sample
Msbuild SlnFolders.sln /t:rebuild

Error MSB4025

In certain cases integrating our agent as part of MSBuild causes the build to fail with 'Error MSB4025: The project file could not be loaded. Could not find file ... .metaproj'

This can be solve by doing the following:

MSBuild Version

SolutionSampl
14Set the MSBuildEmitSolution environment variable to 1 before running MSBuild
set MSBuildEmitSolution=1
Msbuild SlnFolders.sln
15Add the --msBuildVersion 15 flag to the prepareForMsBuild command
SL.DotNet.exe prepareForMsBuild  --buildSessionIdFile buildSessionId.txt --workspacePath "C:\path\to\project" --msBuildVersion 15
  • No labels