Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 923501

Summary: dev-dotnet/dotnet-sdk-bin - Missing DLL hostfxr.dll (picked instead of libhostfxr.so a.k.a. DOTNET_ROOT leaks into Wine?)
Product: Gentoo Linux Reporter: Neko-san <gentoo.qxrin>
Component: Current packagesAssignee: dotnet project <dotnet>
Status: RESOLVED INVALID    
Severity: normal CC: gentoo.qxrin, xgqt
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Neko-san 2024-02-02 00:11:05 UTC
I was attempting to run a dotnet 8 application in Wine 9.0, and had the Windows dotnet runtimes installed in the prefix, but the terminal output seems to expect that the following DLL be included with the Linux SDK and it isn't present:

0274:err:eventlog:ReportEventW L"Description: A .NET application failed.\n"
0274:err:eventlog:ReportEventW L"Application: PKHeX.exe\n"
0274:err:eventlog:ReportEventW L"Path: Z:\\mnt\\chonker\\Gaming\\Modding\\PKHeX\\PKHeX.exe\n"
0274:err:eventlog:ReportEventW L"Message: Error: the required library hostfxr.dll could not be found in [Z:\\opt\\dotnet-sdk-bin-8.0\\host\\fxr\\8.0.1]\n"
Comment 1 Maciej Barć gentoo-dev 2024-02-02 20:07:26 UTC
Hello Neko-san!

You wrongly assigned the bug to dotnet-sdk because in your path I can see you are running the binary version - "\\opt\\dotnet-sdk-bin-8.0\\...".

It seems like Wine wants to pick .dll instead of .so and that's why it's failing to load.

> $ ll /usr/lib64/dotnet-sdk-8.0/host/fxr/8.0.1/
> -rwxr-xr-x 1 root root 3,5M 02-02 08:41 libhostfxr.so*

Im pretty sure you should install a dotnet SDK for Windows inside your Wine prefix and then run an app you compiled **with windows RID** on Linux inside said prefix. But whether the cross-RID compilation works - I had not checked.

Maybe because you did not set the RID or maybe because DOTNET_ROOT env var leaked into your Wine prefix you are getting this weird behavior.

Please report:
- what happens if you try unsetting DOTNET_ROOT while starting 
  **and** while using Wine,
- if you were compiling the app, then: 
  can you force-set a Windows RID, compile your app and then run it in prefix?
Comment 2 Neko-san 2024-02-02 21:48:25 UTC
Unsetting the value seems to fix it.
The application still doesn't work (unhandled exception with Wine), but at least Wine properly attempts to load it now.

Also, to clarify, I wasn't building it (although it is open-source) but thanks for helping me identify why that was happening. Don't know why that value leaks.
Comment 3 Maciej Barć gentoo-dev 2024-02-02 21:53:07 UTC
(In reply to Neko-san from comment #2)
> Unsetting the value seems to fix it.
> The application still doesn't work (unhandled exception with Wine), but at
> least Wine properly attempts to load it now.
> 
> Also, to clarify, I wasn't building it (although it is open-source) but
> thanks for helping me identify why that was happening. Don't know why that
> value leaks.

It leaks because you are using the new open-source .NET SDK, I think if you had used older one DOTNET_ROOT would not be supported.

On the other hand, instead of unsetting DOTNET_ROOT you canm ask or check if devs have made a self-contained binary that does not use system .NET.

Im closing this a s invalid but really it should be "not planned".
Comment 4 Neko-san 2024-02-02 21:58:13 UTC
They don't. And they're pretty against supporting Linux via Wine too; they explicitly only support Windows:
https://projectpokemon.org/home/forums/topic/38168-frequently-asked-questions/

And they don't even host the binary on the github release page:
https://github.com/kwsch/PKHeX/releases