Skip to content

TestRunner.exe not deployed to the assemblies folder #550

Description

@sakanni

Description:

TestRunner can no longer be run locally. Seemingly related to the SDK-style upgrade (#540) which moved it from net472 to net8.0.

Two things are broken:

  1. TestRunner.exe never reaches C:\ProgramData\BHoM\Assemblies. The post-build still copies $(TargetDir)$(TargetFileName), and on .NET Core $(TargetFileName) is TestRunner.dll, not the exe. Checked on a minimal net8.0 exe: TargetFileName = TestRunner.dll, TargetExt = .dll. The exe is built, it just isn't copied.

  2. Copying the exe across by hand doesn't help either. BHoM, Test_oM etc. are referenced with Private=False, so they are never copied next to the output. On .NET Framework that was fine because the exe was deployed into the assemblies folder and the runtime probed the app base directory. .NET Core builds its assembly list from deps.json, and a Private=False reference is compile-only so it never appears there. Confirmed on a minimal repro: with deps.json present the dependency sitting directly next to the exe still fails; delete deps.json and it loads.

Deleting deps.json only moves the failure along one assembly at a time (Test_oM, then Test_Engine, then the package dlls), since the folder then has to hold the whole dependency closure.

Ruled out while diagnosing:

  • The <Target Name="PostBuild" AfterTargets="PostBuildEvent"> pattern does still fire under the SDK, verified on a probe (1 File(s) copied).
  • BHoM.dll and Test_oM.dll are netstandard2.0 and load fine on net8, so the dependencies' target framework is not the problem.

Also worth flagging: build output has moved from Build\ to Build\net8.0\ (and Build\netstandard2.0\ for the libraries), as AppendTargetFrameworkToOutputPath defaults to true and isn't set anywhere.

Steps to reproduce:

  1. Build the toolkit.
  2. Run C:\ProgramData\BHoM\Assemblies\TestRunner.exe <TestName>.
'C:\ProgramData\BHoM\Assemblies\TestRunner.exe' is not recognized as an internal or external command
  1. Copy TestRunner.exe, TestRunner.dll and TestRunner.runtimeconfig.json from Build\net8.0\ into the assemblies folder and run it again.
Unhandled exception. System.IO.FileNotFoundException:
Could not load file or assembly 'Test_oM, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at TestRunner.Program.Main(String[] args)

Expected behaviour:

TestRunner is runnable locally after a build.

Test file(s):

Metadata

Metadata

Assignees

Labels

type:bugError or unexpected behaviour

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions