Game not starting (System.Threading.SynchronizationLockException)

JaayD

Terrarian
I've been trying to play since yesterday but the game wont start and everytime i try to run it i get this error

System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
at Terraria.IO.Preferences.Save(Boolean createFile)
at Terraria.Main.SaveSettings()
at Terraria.Main.OpenSettings()
at Terraria.Main.ClientInitialize()
at Terraria.Main.Initialize()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)

I've tried reinstalling, veryfing integrity, reinstaling XNA but nothing works out

Also I've been looking around everywhere and it seems like the game is not creating the config.json file

Here's my specs:
Windows 10 64bit
Intel core i7-6700k
16GB RAM
NVidia GeForce GTX 1070
 
not creating the config.json seems like a rights issue.
try launching it in admin or compatibility mode


otherwise look at this : https://steamcommunity.com/app/105600/discussions/0/530645961937688315/

also this on the same page : https://forums.terraria.org/index.php?threads/system-threading-synchronizationlockexception.29642/

Yeah, i've also tried with admin and compatibility mode

The fist link says that he fixed it by editing the config file, so that cant be because mine doesnt even create the file

And the second one doesnt even fixed it :/

EDIT: the funny thing is, it works perfectly fine on my laptop but not on my desktop which is my main computer

EDIT 2: since it worked on my laptop i tried to transfer the game files from there. So now it opens but when i try to change the settings or make a character it crashes with this error.

System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
at Terraria.IO.Preferences.Save(Boolean createFile)
at Terraria.Main.SaveSettings()
at Terraria.Main.DrawMenu(GameTime gameTime)
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
 
Last edited:
I wish you had said so from the beginning, always annoying to suggest stuff already tried
anyway, I suggest you try to alter file & folder's rights/permissions

AFAIK there's only two reasons for config file writing errors : wrong permissions/rights for the account
or problematic storage device

IF setting files & folder permissions doesn't fix it then I suggest you take a look at crystal disk info for your storage devices health.
Otherwise no other idea.
 
I might have found the issue but dont know how to fix it. When i open the properties of the folder it checks the Read Only option, but everytime i uncheck it, it comes back again. Do you know how can i fix this?

I have on the Security tab that everything has Total control over the permissions of that folder, so i dont know why it doesnt stay as unchecked
 
I'm not sure it's the source of the issue tbh,
1st ) try checking & setting the read-only status on files maybe ?

2 ) otherwise start an elevated command prompt, navigate to the proper folder using "cd" and try using "attrib"
https://answers.microsoft.com/en-us...g/b02b2254-cd4d-4e50-a68a-cae8c748d086?auth=1
https://support.microsoft.com/en-us...-the-read-only-or-the-system-attributes-of-fo

sidenote: my own folder :
"documents\my games\terraria" is half readonly (neither unchecked nor checked, painted instead)
 
It was a permissions issue for me.
1st) Go to your documents folder where the terraria saves are
2)Right click on the Terraria folder and hit properties
3) go to the security tab and and make sure the groups have all permissions enabled
There were two groups that didnt have all permissions enabled and after I enabled them they disappeared.
They were called ALL APPLICATION PACKAGES and can't remember the other


EDIT: NVM idk what happened but it doesnt work again
 
Last edited:
Back
Top Bottom