Skip to content

System.IO.IOException

Aubergine edited this page Feb 8, 2022 · 11 revisions

Verified: February 2022 - TM:PE 11.6.4.7

TM:PE team: Check the folder path for stuff like DODI-Repacks and other indicators of the game being pirated.

Symptom

You might see errors such as:

  • System.Exception
  • System.IO.IOException
  • System.Reflection.TargetInvocationException

On inspecting your log file, you find something mentioning TMPE.log.

Example log messages (folder paths truncated for sake of brevity):

System.IO.IOException: Sharing violation on path D:\SteamLibrary\steamapps\...\Cities_Data\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 

or:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.TypeInitializationException: An exception was thrown by the type initializer for
TrafficManager.State.GlobalConfig --->
System.UnauthorizedAccessException: Access to the path "...\Steam\steamapps\...\Cities_Data\TMPE.log" is denied.

or:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
System.UnauthorizedAccessException: Access to the path "...\Steam\steamapps\...\Cities_Data\TMPE.log" is denied.

or:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for TrafficManager.State.GlobalConfig ---> System.UnauthorizedAccessException: Access to the path
"/private/var/folders/.../Cities.app/Contents/TMPE.log"

Note: A similar error, System.IO.IOException Win32 IO returned 112, is caused by running out of disk space.

Cause

#292: The System.Exception error is caused by faulty installation of the game on a different disk drive (ie. not Drive C:).

#629: The System.IO.IOException error can also be caused by incorrect move of game to different drive.

#802: The System.Reflection.TargetInvocationException error is caused by insufficient access rights to the folder where the log is being created.

Solution

First, check your disk drive isn't full. Check both the main disk drive (where your Operating System loads from, usually C: on Windows) and also the drive where the game is installed. If it's full, free up space and try again.

If it's still not working...

As of TM:PE 11.6.2 you can specify where the log file should go via command line parameter. For details see TMPE.log.

Fixed?

If not, and the error mentions TMPE.log, please let us know: Report a bug

Other issues? See: Troubleshooting

Clone this wiki locally