rockerbacon / modorganizer2-linux-installer

An easy-to-use Mod Organizer 2 installer for Linux
GNU General Public License v3.0
905 stars 75 forks source link

.NET Script Framework fails to load without dotnet48 #139

Closed davidtjones closed 11 months ago

davidtjones commented 3 years ago

I found another issue that might help others, but may simply be a quirk of Arch-based distros.

My setup: Distro: Arch Linux Game: Skyrim SE through Mod Organizer 2

When loading the mod .NET Script Framework, nothing is ever initialized and dependent mods will not load properly. After installing dotnet48 and xact64 through protontricks, I was able to successfully load both .NET Script Framework and Immersive First Person View (IFPV). More info on this is below.

To install .NET Script Framework, I had to manually create a mod folder in MO2 mods folder and then copy the contents of the mod's archive to this folder (it doesn't seem to install properly via nexus download). After loading SkyrimSE with .NET Script Framework enabled, no dependent mods are loaded but the game functions normally otherwise. I began tracing through this issue by checking binkw.log in the Skryim folder. This log reported that the DLL Loader was unable to initialize. Additionally, there was no information in the logs for .NET Script Framework. After installing dotnet48 through protontricks, I was able to confirm that IFPV worked in-game via correct behavior but also by seeing that binkw.log in the Skyrim directory contained the output:

Checking "Data\DLLPlugins\NetScriptFramework.Runtime.dll" ... OK - loaded and called Initialize().

I was also able to see that the log located in the .NET Script Framework mod folder, NetScriptFramework.log.txt contained the following output, which confirmed that two plugins had been loaded successfully:

[11 Aug 2020 14:57:05.651] Initializing framework version 9.
[11 Aug 2020 14:57:05.659] Loaded configuration file.
[11 Aug 2020 14:57:05.661] Preparing .NET code hooking.
[11 Aug 2020 14:57:05.665] Loading game library.
[11 Aug 2020 14:57:06.552] Loaded game library for `The Elder Scrolls V: Skyrim Special Edition` (13).
[11 Aug 2020 14:57:06.552] Running game version is 1.5.97.0
[11 Aug 2020 14:57:12.036] Loading plugins.
[11 Aug 2020 14:57:12.036] Path to plugins: "Data\NetScriptFramework\Plugins".
[11 Aug 2020 14:57:12.039] Checking file "BugFixesSSE.dll"...
[11 Aug 2020 14:57:12.041] Plugin found and loaded.
[11 Aug 2020 14:57:12.041] Checking file "IFPV.dll"...
[11 Aug 2020 14:57:12.045] Plugin found and loaded.
...

I no longer have the original log, but the original log also reported that XAudio_2_7.dll failed to load directly below the lines above. I was unsure how to proceed, but I tried installing xact64 through protontricks. After this step, everything worked properly. SkyrimSE loaded without issue through SKSE, audio was present, and IFPV was enabled. The new NetScriptFramework.log.txt had the additional lines:

[11 Aug 2020 14:57:12.085] Finished loading 2 plugins.
[11 Aug 2020 14:57:12.085] Finished framework initialization.
davidtjones commented 3 years ago

It seems I spoke too soon. After playing for 10 minutes, I eventually re-encountered the issue:

11 Aug 2020 16:40:17.648] Initializing framework version 9.
[11 Aug 2020 16:40:17.655] Loaded configuration file.
[11 Aug 2020 16:40:17.658] Preparing .NET code hooking.
[11 Aug 2020 16:40:17.664] Loading game library.
[11 Aug 2020 16:40:19.224] Loaded game library for `The Elder Scrolls V: Skyrim Special Edition` (13).
[11 Aug 2020 16:40:19.224] Running game version is 1.5.97.0
[11 Aug 2020 16:40:26.961] Loading plugins.
[11 Aug 2020 16:40:26.961] Path to plugins: "Data\NetScriptFramework\Plugins".
[11 Aug 2020 16:40:26.964] Checking file "BugFixesSSE.dll"...
[11 Aug 2020 16:40:26.966] Plugin found and loaded.
[11 Aug 2020 16:40:26.966] Checking file "IFPV.dll"...
[11 Aug 2020 16:40:26.970] Plugin found and loaded.
[11 Aug 2020 16:40:27.009] Finished loading 2 plugins.
[11 Aug 2020 16:40:27.009] Finished framework initialization.
[11 Aug 2020 16:50:58.124] Unhandled native exception occurred at 0x3FCB1CA2 (XAudio2_7.dll+71CA2) on thread 556!
davidtjones commented 3 years ago

Potentially found a fix for this. Removed xact64 and installed the latest FAudio build from here (20.01). I have tested for a little while but haven't run into anything related to the .NET Framework mod.

rockerbacon commented 3 years ago

Installing dotnet48 has been problematic but it is on the radar. See #132

Current plan is to move away from Lutris so that Protontricks can be used. I have no idea when I'll have the time to do all that, though.

kleshas commented 3 years ago

I've been bumbling along trying to get this working for days. What are your settings with respect to MO2 in lutris? Specifically, the "Disable Lutris Runtime" and "Prefer System Libraries" settings. AFAIK, when you install dotnet48 (via WINEPREFIX=/path/compatdata/489830 winetricks --force dotnet48) you would need to disable "Prefer System Libraries", or is that wrong? When you have wine-mono installed on arch, you can then choose to use that over the bottle's dotnet48 by enabling the "Prefer System Libraries". Is this right?

Your troubleshooting with binkw.log and the netframework.txt.log was useful when I first started, as there was something in the netframework log, but I've not been able to get anything logged in either since, which tells me that the netframework mod isn't being loaded. Can't find any logs anywhere else related. Game starts up fine when I disable that mod.

davidtjones commented 3 years ago

Had all of this on hold for a while, so I'm a little rusty on the details. I have both of the options you list enabled. I believe these are the default? I don't recall changing them. My settings should be default from 2.8.4 except for what I outline above. I haven't tested on newer versions of skyrimse or this installer.

AFAIK, when you install dotnet48 (via WINEPREFIX=/path/compatdata/489830 winetricks --force dotnet48) you would need to disable "Prefer System Libraries", or is that wrong? When you have wine-mono installed on arch, you can then choose to use that over the bottle's dotnet48 by enabling the "Prefer System Libraries". Is this right?

I've never heard any of this before and I have never messed with mono in relation to this. I am not a wine expert by any stretch, but this installer worked well for the most part. I believe the changes I outline above are the only necessary changes I needed to get .NET working . Unfortunately I have found that getting things working with wine/proton is more of an art than a science. I broke my installation numerous times trying to get this right. One thing I notice (and I'm a little confused by rockerbacon's response now) is that I actually did use protontricks I believe (I even say so in one of the posts). Look like I'm also using proton-5.10.

Finally, could this possibly be unrelated to the installer? I have a minimalist load order that I was using for testing, there may perhaps there is some hint there. image

One thing I notice looking at this is that I rename .NET Script Framework to dotNET Script Framework. A preceding "." denotes a hidden folder in linux, and this may have caused some problems, but again not totally sure.

kleshas commented 3 years ago

Thanks for the feedback. I've had my config on defaults too (don't disable lutris runtime and prefer system libraries). As I have to do a --force to install dotnet48 (and doesn't seem to make any difference anyways) as the regular install quits saying it's broken, I've essentially stopped troubleshooting this and reset the wineprefix. Turns out I only had a couple of mods requiring dotnetframework anyways in the modlist.

I'm also unsure what he meant with the protontricks comment. AFAIK, "protontricks" command is the same as "WINEPREFIX= winetricks " (I've got a ticket open with protontricks dev as mine is broken right now, and he said protontricks is just a wrapper).

I've had it called NET Script Framework so I don't have the . potential issue either.

Continous commented 2 years ago

Installing dotnet48 does work on the shipped version of Proton. With that said, it does break on later versions, and isn't really fully supported on the versions it's working on. Using --force to install dotnet48 is only necessary on these later versions of proton. It's probably better to install using -q because wine still doesn't seem to play well with the msi installer(s). Minimizing their usage is a good hedge against that.