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

Surface Painter does not fail gracefull if ELT not subscribed #4

Open
originalfoo opened this issue Apr 5, 2020 · 2 comments
Open

Comments

@originalfoo
Copy link

It seems to be causing issues with all sorts of network/transport related things too...

sp_output_log.txt

LSM?

The class SurfacePainter.EltPlugin could not be loaded, used in SurfacePainter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0 
  at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IResourceExtension] () [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ColossalFramework.Plugins.PluginInfo:GetInstances()
ColossalFramework.Plugins.PluginManager:GetImplementations()
ResourceWrapper:GetImplementations()
ResourceWrapper:.ctor(NaturalResourceManager)
NaturalResourceManager:CreateRelay()
LoadingManager:MetaDataLoaded()
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
LoadingScreenMod.Util:InvokeVoid(Object, String)
LoadingScreenMod.<LoadLevelCoroutine>d__23:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

ETST?

The class SurfacePainter.EltPlugin could not be loaded, used in SurfacePainter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0 
  at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IUserMod] () [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ColossalFramework.Plugins.PluginInfo:GetInstances()
ElevatedTrainStationTrack.Util:get_AssemblyDirectory()
ElevatedTrainStationTrack.Initializer:SetupElevatedPrefab(NetInfo, Boolean)
ElevatedTrainStationTrack.Initializer:SetupElevatedPrefab(NetInfo)
ElevatedTrainStationTrack.<>c__DisplayClass2_0`1:<Chain>b__0(NetInfo)
ElevatedTrainStationTrack.AbstractInitializer:CreatePrefab(String, String, Action`1)
ElevatedTrainStationTrack.Initializer:InitializeImpl()
ElevatedTrainStationTrack.AbstractInitializer:<Update>b__5_0()
ElevatedTrainStationTrack.<ActionWrapper>d__2:MoveNext()
LoadingManager:Update()

Network Extensions 2?

The class SurfacePainter.EltPlugin could not be loaded, used in SurfacePainter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0 
  at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[IUserMod] () [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ColossalFramework.Plugins.PluginInfo:GetInstances()
Transit.Framework.Tools:get_PluginInfo()
Transit.Framework.Tools:PackageName(String)
Transit.Addon.RoadExtensions.Roads.PedestrianRoads.Common.ZonablePedestrianHelper:AddWoodBollards(NetInfo, NetInfoVersion)
Transit.Addon.RoadExtensions.Roads.PedestrianRoads.GravelTiny.ZonablePedestrianTinyGravelRoadBuilder:LateBuildUp(NetInfo, NetInfoVersion)
Transit.Addon.RoadExtensions.<>c__DisplayClass5_4:<InstallNetInfos>b__4()
Transit.Addon.RoadExtensions.RExModule:OnLevelLoaded(LoadMode)
Transit.Framework.Mod.TransitModBase:OnLevelLoaded(LoadMode)
LoadingWrapper:OnLevelLoaded(UpdateMode)
<LoadLevelComplete>c__Iterator9:MoveNext()
LoadingManager:Update()

Cinematic camera?

The class SurfacePainter.EltPlugin could not be loaded, used in SurfacePainter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
ReflectionTypeLoadException: The classes in the module cannot be loaded.
  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
  at System.Reflection.Assembly.GetExportedTypes () [0x00000] in <filename unknown>:0 
  at ColossalFramework.Plugins.PluginManager+PluginInfo.GetInstances[ICameraExtension] () [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
ColossalFramework.Plugins.PluginInfo:GetInstances()
ColossalFramework.Plugins.PluginManager:GetImplementations()
CameraWrapper:GetImplementations()
CameraWrapper:.ctor(CinematicCameraController)
CinematicCameraController:CreateRelay()
CinematicCameraController:Awake()

etc....

@bloodypenguin
Copy link
Owner

I don't think I can do much about that, because the exception tells the truth :)
But this can be prevented in each individual mod that scans assemblies:
https://stackoverflow.com/questions/7889228/how-to-prevent-reflectiontypeloadexception-when-calling-assembly-gettypes

@originalfoo
Copy link
Author

I've not seem many mods that try directly scanning assemblies, but I'll check the sources of those mods.

In my duplicate assembly scanner I use this:

https://github.com/CitiesSkylinesMods/DuplicateAssemblyScanner/blob/master/DuplicateAssemblyScanner/DuplicateAssemblyScanner/Util/Assemblies.cs#L77-L88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants