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:
-
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.
-
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:
- Build the toolkit.
- Run
C:\ProgramData\BHoM\Assemblies\TestRunner.exe <TestName>.
'C:\ProgramData\BHoM\Assemblies\TestRunner.exe' is not recognized as an internal or external command
- 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):
Description:
TestRunner can no longer be run locally. Seemingly related to the SDK-style upgrade (#540) which moved it from
net472tonet8.0.Two things are broken:
TestRunner.exenever reachesC:\ProgramData\BHoM\Assemblies. The post-build still copies$(TargetDir)$(TargetFileName), and on .NET Core$(TargetFileName)isTestRunner.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.Copying the exe across by hand doesn't help either.
BHoM,Test_oMetc. are referenced withPrivate=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 fromdeps.json, and aPrivate=Falsereference is compile-only so it never appears there. Confirmed on a minimal repro: withdeps.jsonpresent the dependency sitting directly next to the exe still fails; deletedeps.jsonand it loads.Deleting
deps.jsononly moves the failure along one assembly at a time (Test_oM, thenTest_Engine, then the package dlls), since the folder then has to hold the whole dependency closure.Ruled out while diagnosing:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">pattern does still fire under the SDK, verified on a probe (1 File(s) copied).BHoM.dllandTest_oM.dllare 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\toBuild\net8.0\(andBuild\netstandard2.0\for the libraries), asAppendTargetFrameworkToOutputPathdefaults to true and isn't set anywhere.Steps to reproduce:
C:\ProgramData\BHoM\Assemblies\TestRunner.exe <TestName>.TestRunner.exe,TestRunner.dllandTestRunner.runtimeconfig.jsonfromBuild\net8.0\into the assemblies folder and run it again.Expected behaviour:
TestRunner is runnable locally after a build.
Test file(s):