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

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

Open
mtayloooor opened this issue Apr 20, 2023 · 3 comments
Labels
BUG Defect detected triage Awaiting issue categorisation

Comments

@mtayloooor
Copy link

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:
#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! :)

@mtayloooor mtayloooor added BUG Defect detected triage Awaiting issue categorisation labels Apr 20, 2023
@krzychu124
Copy link
Member

Hi,
see #1111

@krzychu124
Copy link
Member

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

@mtayloooor
Copy link
Author

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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Defect detected triage Awaiting issue categorisation
Projects
None yet
Development

No branches or pull requests

2 participants