almenjonatan/terraforming-mars-overlay

Self Contained App

IancuFlorinRadu opened this issue · 4 comments

Got this error when running Frontend.exe

A fatal error occurred. The required library hostfxr.dll could not be found. If this is a self-contained application, that library should exist in [C:\Users\Xenocide\Desktop\TM_Overlay\]. If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].

Seems that the app requires you to have .net core run time installed.
The solution for this is to publish the application with Deployment Mode Self Contained according to this stack overflow post.

https://stackoverflow.com/questions/59284895/a-fatal-error-occurred-the-required-library-hostfxr-dll-could-not-be-found

I have no idea why it does not contain the runtime. It's published as self contained.

Any help would be appreciated!

I have the same error.

Bit of an update:

I was able to clone the repository and build the mod via the command on the next line, which bypassed the preceding error.

dotnet publish -r win-x64 -p:PublishSingleFile=true --self-contained true

Possibly this fixed the problem directly, or possibly it fixed it indirectly by making hostfxr.dll available when I installed .NET. Based on a post in the Discord channel, I suspect the latter.

Regardless, it now says "Waiting for player" at localhost. I'll see if I can solve this problem.

@MichaelHoltonPrice

Did you install overlay.dll and got it to work?

I just tried it out and it worked.