Build AnyCPU instead of x86 so the plugin loads in 64-bit HDT - #2
Open
dtroest wants to merge 1 commit into
Open
Conversation
The plugin is hardcoded to x86 in the project file, the solution and
build.ps1. Hearthstone Deck Tracker 1.53.x runs as a 64-bit process, so
it rejects the resulting 32-bit assembly with
System.BadImageFormatException: An attempt was made to load a program
with an incorrect format.
and the plugin never appears in Options > Tracker > Plugins. Rebuilding
from source does not help, because build.ps1 passes /p:Platform=x86 (and
/platform:x86 in the fallback compiler path), so the output is x86 again.
Switch the platform to AnyCPU everywhere it is pinned:
- HdtCollectionExporter.csproj: default Platform, both configuration
PropertyGroups, PlatformTarget and Prefer32Bit. Output moves from
bin\x86\<Config>\ to bin\<Config>\.
- HdtCollectionExporter.sln: solution and project configurations.
- build.ps1: /p:Platform="Any CPU", /platform:anycpu, and the obj/bin
paths that mirrored the old layout.
- README.md, docs/INSTALL.en.md, docs/INSTALL.ru.md: the documented path
to the built DLL follows the new output location.
No source files are touched. The assembly is IL-only after this change
(ILONLY set, 32BITREQUIRED and 32BITPREFERRED clear), so it loads in
both 32-bit and 64-bit hosts.
Fixes Zulut30#1
|
@dtroest is attempting to deploy a commit to the Zulut 's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi — thanks for the plugin, the collection export is exactly what I needed.
I ran into #1 and this fixes it.
The problem
The plugin is pinned to x86 in three places: the default
PlatforminHdtCollectionExporter.csproj, both configurationPropertyGroups in the samefile, and
build.ps1(/p:Platform=x86, plus/platform:x86in the fallbackcompiler path).
Hearthstone Deck Tracker 1.53.x runs as a 64-bit process, so it refuses the
resulting 32-bit assembly:
Error|PluginManager.GetModule >> Error loading ...\Plugins\HdtCollectionExporter.dll:
System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
The plugin never shows up under Options > Tracker > Plugins. Rebuilding from
source does not help, because
build.ps1forces x86 again — which is what thereporter in #1 also found.
The fix
Switch to AnyCPU everywhere it is pinned: the project file, the solution, and
build.ps1. The output moves from
bin\x86\<Config>\tobin\<Config>\, so thethree docs that name that path are updated to match.
No source files are changed, and the WPF UI is untouched.
Verification
I have been running an AnyCPU build of this code against HDT 1.53.9 since July —
it loads and the export works (8,107 cards on the first run). The resulting
assembly is IL-only:
ILONLY = True
32BITREQUIRED = False
32BITPREFERRED = False
which is what lets it load in both 32-bit and 64-bit hosts.
One thing I could not test: I do not have a Windows build environment set up, so
build.ps1itself is unverified end-to-end on this branch. The platform flags arechanged consistently, but a
build.ps1run on your side would be worth doingbefore merging. Happy to adjust if something in the fallback compiler path needs
more.
Fixes #1