• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows GMS2 Build - Create Executable - Fails (solved)



Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

game plays perfect by clicking Run button
game plays perfect by clicking Build Run
Have tried Build Clean
Have tried running program as administrator
Have tried saving to different locations
The target is Windows | VM | Default | default
Do have visual studio 2015 installed
Have compiled many games with GMStudio on same PC, with zero issues.. In face just opened an old project in GMS and creates application just fine.

Entire pastebin Output
This is with build package as installer

Trying to do package as zip... entire program just freezes forever.

Googles searches, nothing.

Any help or advice is appreciated, thank you for your time.


I cannot edit that post, so to add

IDE version
Current Runtime:

Have tried Target as both VM and YYC (with vs2015 installed)
Last edited by a moderator:


And solved.. Apparently changed something as simple as the Windows Images can create this error.

Remove them and fixed.



nobody important
GMC Elder
Can you break it again and file this as a bug (along with the project)? It would be nice to have a better error if this is the case?


Sorry, just saw this

If you have changed the pictures inside OPTIONS/WINDOWS/IMAGES manually, the build can fail.

Need to use the TOOLS/GENERATE PROJECT IMAGES to change those.

(I dont know if this is a bug as most likely you are supposed to use the generate project images and not manually replace)