CitiesSkylinesMods / TMPE

Cities: Skylines Traffic Manager: President Edition
https://steamcommunity.com/sharedfiles/filedetails/?id=1637663252
MIT License
577 stars 85 forks source link

System.Reflection.TargetInvocationException error when trying to run on Mac from external drive #1741

Open mtayloooor opened 1 year ago

mtayloooor commented 1 year ago

Hello!

Using Steam, I've installed Cities Skylines on an external drive as I don't have enough internal storage to install it on my computer. I am using Mac and the external drive is formatted as exFAT.

I can't get TMPE to run using this setup, each time I try to enable it I get the following error:

A ModTM:PE 11.7.4.0 STABLEcaused an error [ModException]

Details:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: Sharing violation on path /Volumes/LaCie/SteamLibrary/steamapps/common/Cities_Skylines/Cities.app/Contents/TMPE.log
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in <filename unknown>:0 
  at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
  at System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) [0x00000] in <filename unknown>:0 
  at System.IO.StreamWriter..ctor (System.String path, Boolean append) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
  at System.IO.File.AppendText (System.String path) [0x00000] in <filename unknown>:0 
  at CSUtil.Commons.Log.LogToFile (System.String log, LogLevel level) [0x00000] in <filename unknown>:0 
  at CSUtil.Commons.Log.Info (System.String s) [0x00000] in <filename unknown>:0 
  at TrafficManager.State.SavedGameOptions.Ensure () [0x00000] in <filename unknown>:0 
  at TrafficManager.Lifecycle.TrafficManagerMod.OnSettingsUI (.UIHelper helper) [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception

I have a feeling it is similar to this issue: https://github.com/CitiesSkylinesMods/TMPE/wiki/System.Reflection.TargetInvocationException-TMPE.log-is-denined

So I've tried to use game launch options to change the location of the TMPE log file, similar to what's described here: https://github.com/CitiesSkylinesMods/TMPE/pull/1151 From that, I tried "/Volumes/LaCie/SteamLibrary/steamapps/common/Cities_Skylines/Cities.app" -LogFile "Volumes/Macintosh HD/Users/mtayloooor/Downloads/output_log.txt" %command% as a Launch Option in Steam, this DOES actually create the output_log.txt file at that location but still the same error message shows.

I've also tried unsubscribing and resubscribing to the mod in Workshop.

Does this sound like I'm on the right track? I'm a bit stuck. Any help would be appreciated a lot - thank you! :)

krzychu124 commented 1 year ago

Hi, see #1111

krzychu124 commented 1 year ago

Additionally, it seems that Unity runtime engine (Mono) does not support exFAT drives so there is more errors in the log like this

mtayloooor commented 1 year ago

Additionally, it seems that Unity runtime engine (Mono) does not support exFAT drives so there is more errors in the log like this

thank you, damn. the game seems to run fine on the exFAT drive, it's just TMPE that can't be enabled. I'm guessing the only solution is to move CS off the exFAT drive? I can't actually do this because I currently only have space available in exFAT :(