Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown #140

Open
fusion809 opened this issue Jul 3, 2019 · 20 comments
Labels
Blocked Waiting for issue or pull request Crash

Comments

@fusion809
Copy link

Hi,

When launching the AppImage for commit 2b37e35 I get the exception:

Exception of type `System.Reflection.ReflectionTypeLoadException`: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
Could not resolve type with token 010000a8 from typeref (expected class 'OpenRA.Traits.ResourceTypeInfo' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not resolve type with token 010000a8 from typeref (expected class 'OpenRA.Traits.ResourceTypeInfo' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not resolve type with token 010001dd from typeref (expected class 'OpenRA.Activities.CompositeActivity' in assembly 'OpenRA.Game, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null')
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Here's a zip archive for all the relevant logs (only the exception log exists, all others are empty): logs-20190703-d2.zip.

@evgeniysergeev
Copy link
Collaborator

Hello, @fusion809,
Is this reproduced on latest code?

@fusion809
Copy link
Author

Yep, I'm afraid so.

@GraionDilach
Copy link

AppImages built upon the last release requires a proper Mono framework upon the system.

#146 has been merged though so I really try for a reproduction, since that bumped everything to playtest.

@fusion809
Copy link
Author

fusion809 commented Sep 28, 2019

Seems unlikely to be the cause, as I can run Dune II without a problem using ./launch-game.sh, after manually compiling it. I can also run it from my AUR package of it. Likewise, I can run Red Alert, Dune 2K and Tiberian Dawn AppImages built on this system from the latest commits of the upstream OpenRA repo (https://github.com/OpenRA/OpenRA).

@GraionDilach
Copy link

Yes, you're correct with that not being the cause - just found it here:

using System.Drawing;

@evgeniysergeev Upstream removed System.Drawing usage because that lead to a lot of dependencies required to be integrated into the AppImage and the crash is caused by this. You need to follow suit, OpenRA/OpenRA#15973 gives you the examples to look at.

@evgeniysergeev
Copy link
Collaborator

evgeniysergeev commented Sep 28, 2019

Yes, you're correct with that not being the cause - just found it here:

using System.Drawing;

@evgeniysergeev Upstream removed System.Drawing usage because that lead to a lot of dependencies required to be integrated into the AppImage and the crash is caused by this. You need to follow suit, OpenRA/OpenRA#15973 gives you the examples to look at.

Should be fixed in #154
But this is changes only in d2 mod, not in modSdk. for modSDK waiting for OpenRA/OpenRAModSDK#123

@evgeniysergeev evgeniysergeev added the Waiting for upstream Wait for changes in OpenRA engine label Sep 28, 2019
@GraionDilach
Copy link

The ModSDK issue is limited to the Windows path however and should not involve a running AppImage. So #154 should fix the crash here.

@evgeniysergeev
Copy link
Collaborator

evgeniysergeev commented Sep 28, 2019

#154 merged

@fusion809
Copy link
Author

Ah, folks I hate to be a buzzkill but the AppImage issue seems to have survived. I am still getting that error.

@GraionDilach
Copy link

GraionDilach commented Sep 28, 2019

d2/mod.config

Line 137 in f213467

WHITELISTED_CORE_ASSEMBLIES="mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll OpenRA.Mods.Cnc.dll System.Drawing.dll"
was not updated compared to
https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

@evgeniysergeev
Copy link
Collaborator

d2/mod.config

Line 137 in f213467

WHITELISTED_CORE_ASSEMBLIES="mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll OpenRA.Mods.Cnc.dll System.Drawing.dll"

was not updated compared to
https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

This will be updated in #156

@evgeniysergeev
Copy link
Collaborator

d2/mod.config

Line 137 in f213467

WHITELISTED_CORE_ASSEMBLIES="mscorlib.dll System.dll System.Configuration.dll System.Core.dll System.Numerics.dll System.Security.dll System.Xml.dll Mono.Security.dll OpenRA.Mods.Cnc.dll System.Drawing.dll"

was not updated compared to
https://github.com/OpenRA/OpenRAModSDK/blob/5e1de7189d140049f91b3f88f3771b4c97f0b47a/mod.config#L137

This will be updated in #156

#156 merged

@fusion809
Copy link
Author

Sorry folks, but the error still seems to exist with the latest commit.

@pchote
Copy link
Member

pchote commented Oct 4, 2019

There seems to be several layers of problems here...

The errors reported by make check will need to be fixed before the AppImage has any chance of reliably working (hint: you are using the Mods.Cnc dll but don't tell the SDK to package it). You should also go back through the instructions in https://github.com/OpenRA/OpenRAModSDK/releases/tag/20190825 and redo the mod.config changes. Your dll whitelist definitions, in particular, are not set up correctly.

We put a lot of effort into building the make check and make test commands to automatically identify errors like this. You would save a lot of trouble by running these a regular part of your workflow and taking the time to understand what causes them.

Both the AppImage and launch-game scripts crash on startup for me because the load screen can't find IBM.PAL. The load screen and content installer must not reference any external files because users will not otherwise be able to install them!

@evgeniysergeev
Copy link
Collaborator

Waiting for #160 #161 #162

@evgeniysergeev evgeniysergeev pinned this issue Oct 4, 2019
@evgeniysergeev
Copy link
Collaborator

Can we try to package and run again, after #163 will be merged

@fusion809
Copy link
Author

Sure, happy to give it a go.

@evgeniysergeev
Copy link
Collaborator

evgeniysergeev commented Oct 5, 2019

Sure, happy to give it a go.

You can test using https://github.com/evgeniysergeev/d2/tree/fix-tests branch this way you don’t need to wait for merge and we will know is that changes helps or not

@fusion809
Copy link
Author

Odd, I get this error when building the AppImage:

Installing OpenRA engine to /data/GitHub/others/d2-fork/packaging/linux/D2Mod.appdir/usr/lib/openra
Installing OpenRA common mod files to /data/GitHub/others/d2-fork/packaging/linux/D2Mod.appdir/usr/lib/openra
cp: cannot stat './mods/cnc/OpenRA.Mods.Cnc.dll': No such file or directory

@fusion809
Copy link
Author

If it helps running:

find . -name "OpenRA.Mods.Cnc.dll"

in the top level of this repo, returns:

./engine/mods/common/OpenRA.Mods.Cnc.dll
./engine/OpenRA.Mods.Cnc/obj/Release/OpenRA.Mods.Cnc.dll
./packaging/linux/D2Mod.appdir/usr/lib/openra/mods/common/OpenRA.Mods.Cnc.dll

@evgeniysergeev evgeniysergeev unpinned this issue Nov 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocked Waiting for issue or pull request Crash
Projects
None yet
Development

No branches or pull requests

4 participants