Skip to content

Fix portable project build#40

Closed
Sean-Kenneth-Doherty wants to merge 1 commit into
zer0Kerbal:masterfrom
Sean-Kenneth-Doherty:fix-audio-startup-build
Closed

Fix portable project build#40
Sean-Kenneth-Doherty wants to merge 1 commit into
zer0Kerbal:masterfrom
Sean-Kenneth-Doherty:fix-audio-startup-build

Conversation

@Sean-Kenneth-Doherty
Copy link
Copy Markdown

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty commented May 17, 2026

Problem

The project file does not build cleanly outside a Windows/Visual Studio layout. On Linux with KSP 1.12.5 assemblies, xbuild stops before compilation because SolarScience.csproj unconditionally imports the Visual Studio TextTemplating targets path:

SolarScience.csproj could not import "$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v17.0\TextTemplating\Microsoft.TextTemplating.targets"

The project also references Properties\Version.cs, while the tracked generated file is Properties\version.cs, which breaks on case-sensitive filesystems.

Changes

  • Uses the tracked Properties\version.cs filename in the project file.
  • Makes the TextTemplating targets import and TextTransform.exe pre-build step conditional.
  • Makes the Windows deploy/release post-build hook conditional so a source build can write to an explicit output folder when the batch files are absent.

This is intentionally build-only; no runtime C# source files are changed.

Validation

Environment: KSP 1.12.5.3190 assemblies from Steam, Mono/xbuild 14.0 on Linux.

  • origin/master project file: fails before compilation with the missing TextTemplating targets import.
  • This branch:
xbuild source/SolarScience.csproj \
  /p:Configuration=Release \
  /p:K112="/home/sean/.local/share/Steam/steamapps/common/Kerbal Space Program/KSP_Data/Managed/" \
  /p:OutputPath="/home/sean/Projects/ksp-mod-updates/artifacts/SolarScience-proof/portable-build/" \
  /p:PostBuildEvent= \
  /verbosity:minimal

Build result: succeeded, producing SolarScience.dll with SHA-256 f3d894d6296f62df7af4ffc1413cbf2c0a0eac6ac27d19c8902e591f58dc5baa.

Additional KSP load check: installed that DLL into a disposable KSP 1.12.5.3190 GameData with SolarScience assets. A proof addon reached MainMenu, found both KMI and STEREO, called their module startup path, loaded both opening audio clips, and reported OVERALL result=PASS. The log had no NullReferenceException, TypeLoadException, or MissingMethodException.

@Sean-Kenneth-Doherty Sean-Kenneth-Doherty changed the title Fix audio startup initialization and portable project build Fix portable project build May 18, 2026
@Sean-Kenneth-Doherty
Copy link
Copy Markdown
Author

Closing this under my tightened quality bar rather than leaving a source-build-only draft in your queue. The branch has useful local build/load checks, but there is no current issue or maintainer request behind it, and it does not change runtime behavior. I will not reopen unless there is a concrete maintainer-requested build/release need or a player-facing defect with proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant