HexiDave / SubnauticaMods

Subnautica Mod Repostiory
MIT License
4 stars 2 forks source link

failed to patch the main assembly file #1

Closed FillPavS closed 6 years ago

FillPavS commented 6 years ago

Instructions Extract to your Subnautica folder and run AssemblyPatcher.exe

But when I run the file, I get an error :(

204

wolrah commented 6 years ago

I am experiencing the same thing, here is the error in English: image

Failed to patch the main assembly file:

Could not load file or assembly 'dnlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=50e96378b6e77999' or one of its dependencies. The system cannot find the file specified.
   at AssemblyPatcher.Program.PatchMainAssembly()
   at AssemblyPatcher.Program.Main(String[] args)

I'm guessing that means dnlib wasn't correctly linked in to the exe in the release package.

HexiDave commented 6 years ago

My fault - I had forgotten to include two libraries into the release package. I'm still adjusting the build system for automated releases.

If you check the latest release (https://github.com/HexiDave/SubnauticaMods/releases/tag/v2.0) you should be good to go, along with a new mod!

Let me know if you still have this problem with the new release.

wolrah commented 6 years ago

Just tested the new release and it worked as expected. I didn't fully test all the mods but MoreQuickSlots and PullFromContainer were definitely working as expected. Looks good to me!

HexiDave commented 6 years ago

Great! Thanks for checking. Gonna close this. @FillPavS - if you're still having issues, let me know and I'll re-open and investigate.

FillPavS commented 6 years ago

@HexiDave, problem still exists. When I run the file AssemblyPatcher.exe, the following happens. 205

If I copy the files BootstrapLib.dll, dnlib.dll side by side to the file AssemblyPatcher.exe then there will be another error 206

if I copy the mods folder on the path specified in the window, I get an error too 207

sorry for my English. I hope you got what I meant ;)

HexiDave commented 6 years ago

Hm, the way the files should be organized would be that the AssemblyPatcher goes in the root subnautica folder, the BootstrapLib and dnlib files should be in the Subnautica/Subnautica_Data/Managed folder, and the Mods folder should be there, too. Make sure that they aren't in other folders as duplicates or it can throw off the way they look for files.

On Feb 17, 2018 4:20 PM, "FillPavS" notifications@github.com wrote:

HexiDave, problem still exists. When I run the file AssemblyPatcher.exe, the following happens. [image: 205] https://user-images.githubusercontent.com/17209082/36345649-637dd2d6-1440-11e8-9702-89bca40490c3.png

If I copy the files BootstrapLib.dll, dnlib.dll side by side to the file AssemblyPatcher.exe then there will be another error [image: 206] https://user-images.githubusercontent.com/17209082/36345700-02fc1d18-1441-11e8-9e79-073a7f3def60.png

if I copy the mods folder on the path specified in the window, I get an error too [image: 207] https://user-images.githubusercontent.com/17209082/36345725-5c52a67a-1441-11e8-8722-996be5dee6fc.png

sorry for my English. I hope you got what I meant ;)

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/HexiDave/SubnauticaMods/issues/1#issuecomment-366472275, or mute the thread https://github.com/notifications/unsubscribe-auth/AHNH9oGNTTWDTiakGiXgwyPKVN8ixVggks5tV0KigaJpZM4SIUkf .

HexiDave commented 6 years ago

Re-opening this until I hear that it's resolved for you - I want to make sure there isn't a situation I'm not seeing.

FillPavS commented 6 years ago

@HexiDave, at first i used the location of the files as in the archive. Maybe I need to install additional software? Visual Studio or another?

HexiDave commented 6 years ago

Hm, you might need the .NET 4.6.1 runtime to operate the patcher, but it should be installed by default on Win7+

You can try it here: https://www.microsoft.com/en-us/download/details.aspx?id=49981

I'd suggest making sure that none of the files are anywhere from your earlier tests - remove from Subnautica's folder and any sub-folders:

Then run the Steam file verification step:

Then give it another shot with the latest release available: https://github.com/HexiDave/SubnauticaMods/releases/latest

FillPavS commented 6 years ago

@HexiDave, I did as you said, but the result is the same :( 208 209

Does the patcher have a debug or log? I think that the problem with the definition of the path

HexiDave commented 6 years ago

It doesn't have anything that would help here, but I'll be adding something more robust in the next few days. Sorry you're having so much trouble with it!

Someone else ran into a very similar problem and found that Windows Defender was holding some of the files hostage. I'll understand if you don't want to do this, but could you try adding a folder exclusion for Subnautica?

https://support.microsoft.com/en-us/help/4028485/windows-10-add-an-exclusion-to-windows-defender-antivirus

If you have a different anti-virus program running, it also might be holding onto the DLLs since they're modifying other binaries - which is generally regarded by most security programs as extremely sketchy.

FillPavS commented 6 years ago

Yes, I have another antivirus program installed, and the Windows defender is turned off. I completely disabled the antivirus, but the error still exists. I'll wait until more people will use your great mods, and maybe someone else will be a similar problem. And then you can find a regularity. Thanks

Now I have a patched version of the dll first version and I'm still going to play with him. I downloaded it from the link under the video on YouTube.

greymatter42 commented 6 years ago

Hey @FillPavS I was running into similar issues and was able to finally run the patcher after unblocking all included dlls in the managed and mods directories. Hope this helps!

Also, thanks for the work Helix!

screen shot 2018-02-19 at 6 24 02 pm

FillPavS commented 6 years ago

@greymatter42, this helps! Thanks for the solution!!! @HexiDave, many thanks for the mods!!!