Problem with loading dotnet hostfxr from c++

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
OmegaMetor
Newbie
Newbie
Posts: 1
Joined: Sat Apr 15, 2023 11:09 pm

Problem with loading dotnet hostfxr from c++

Post by OmegaMetor »

I have a c++ dll that uses the hostfxr to load c# dll's in order to mod a game. The game is for windows only, hence why it's being run through wine. Currently I'm running into an error in the loading related to the hostfxr not being loaded and/or located. The error message simply states "Error when loading hostfxr". This error stems from the get_hostfxr_path function of dotnet called while attempting to load the hostfxr. Looking through the dotnet runtime's source I can find 2 calls to the windows api used to load this, GetModuleFileNameW and GetModuleHandleW. I doubt there is a problem in wine with these functions given their importance, but was wondering what could cause them to fail in this case. The hostfxr library does exist in the prefix, and the dll is otherwise findable, so I'm not sure why it isn't working. It could also be unrelated to those functions, that's just what I was able to figure out about it. Wine version is 8.2.
winspool
Level 2
Level 2
Posts: 19
Joined: Fri Feb 22, 2008 3:39 pm

Re: Problem with loading dotnet hostfxr from c++

Post by winspool »

You can use the WINEDEBUG environment variable
to let wine generate a verbose log in the console.
(and save that also in a logfile with 'tee' )

I redirect stderr to stdout to have both in the log
and to reduce the logfile size, i start wine before with:
wine control &

And then the problematic program:
WINEDEBUG=+module wine yourapp.exe | tee logfile.txt

--
Regards ... Detlef (winspool)
Bilski
Newbie
Newbie
Posts: 3
Joined: Thu Jun 29, 2023 11:55 pm

Re: Problem with loading dotnet hostfxr from c++

Post by Bilski »

winspool wrote: Sat Jun 10, 2023 6:48 pm You can use the WINEDEBUG environment variable
to let wine generate a verbose log in the console.tiny fishing
(and save that also in a logfile with 'tee' )

I redirect stderr to stdout to have both in the log
and to reduce the logfile size, i start wine before with:
wine control &

And then the problematic program:
WINEDEBUG=+module wine yourapp.exe | tee logfile.txt

--
Regards ... Detlef (winspool)
I tried this and it works.
Locked