• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

LibGit2Sharp Exception: Exception has been thrown by the target of an invocation.

Petrik33

Member
I use Game Maker Studio implemeted Source Control, this problem have started to appear every second yesterday. I used create repository option for source control, what to do with it?
 

Roldy

Member
Post the whole error if there is more to it.

When does the error occur: When you start GMS? When you try to commit? When you change a file? Etc..
 

Petrik33

Member
Post the whole error if there is more to it.

When does the error occur: When you start GMS? When you try to commit? When you change a file? Etc..
This just appears in the outlog every second that I try doing anything. And that is the whole error, nothing more. It doesn't crash the IDE or something, but it just appears every second so I can't do anything
 

Roldy

Member
Typically there is a second part to that error; it states an exception was thrown and then it says the specific exception. But if its not showing that then thats too bad.

If you just want to get back to working then I'd suggest simply turning off Source Control for the project. Game Options->Enable Source Control (uncheck this box).
You can use Git without GMS knowing anything about it. In fact I would suggest using git through command line anyway and just use the GMS integration as a helper.

Without GMS involved, use the command line and check the status of your repo. Make sure you can pull/push/commit etc.. without problems. This may give you a clue what is going wrong.

If there are no problems with git and your repo then make a new GMS test project, enable source control, and see if that will work. That should tell you if the problem is with your specific project or GMS/LibGit2Sharp.

Other than that can you think of what occurred before this started happening. Where you using GMS and Git fine and then something changed (you moved something, reinstalled something etc.) and the problem occurred. Or has it never worked correctly?
 

Petrik33

Member
Typically there is a second part to that error; it states an exception was thrown and then it says the specific exception. But if its not showing that then thats too bad.

If you just want to get back to working then I'd suggest simply turning off Source Control for the project. Game Options->Enable Source Control (uncheck this box).
You can use Git without GMS knowing anything about it. In fact I would suggest using git through command line anyway and just use the GMS integration as a helper.

Without GMS involved, use the command line and check the status of your repo. Make sure you can pull/push/commit etc.. without problems. This may give you a clue what is going wrong.

If there are no problems with git and your repo then make a new GMS test project, enable source control, and see if that will work. That should tell you if the problem is with your specific project or GMS/LibGit2Sharp.

Other than that can you think of what occurred before this started happening. Where you using GMS and Git fine and then something changed (you moved something, reinstalled something etc.) and the problem occurred. Or has it never worked correctly?
Okay, I will try doing that, and honestly this problem appeared just randomly, during a simple workflow and I did nothing with my source control, and by the way, I have seen a thread with some sort of similar problem, and the solution was connected with .gitatributes file, but I can't find it on my PC, where can it be? And also, thank you!
 

Roldy

Member
Okay, I will try doing that, and honestly this problem appeared just randomly, during a simple workflow and I did nothing with my source control, and by the way, I have seen a thread with some sort of similar problem, and the solution was connected with .gitatributes file, but I can't find it on my PC, where can it be? And also, thank you!
The .gitattributes file is optional, similar to how .gitignore is optional: https://git-scm.com/docs/gitattributes

So you might not have one.

But also it is a hidden file, so if you did have it you would need to enable viewing hidden files in windows, or in cmd use DIR with /a:h option, or in a bash shell use 'ls -la' to see them. FYI, in many OS's (including windows, *nix) when files start with a dot '.gitattributes' that makes them 'hidden' files.

But it is likely you don't even have a .gitattributes file. But you can create one. I am guessing you already saw this thread: https://forum.yoyogames.com/index.p...-thrown-by-the-target-of-an-invocation.78274/

If .gitattributes can help you then I imagine possibly you added a file type in the repo that git is confused about and it doesn't, or can't, treat it as text/diff/bin... I would be curious to what the answer is.
 

Petrik33

Member
The .gitattributes file is optional, similar to how .gitignore is optional: https://git-scm.com/docs/gitattributes

So you might not have one.

But also it is a hidden file, so if you did have it you would need to enable viewing hidden files in windows, or in cmd use DIR with /a:h option, or in a bash shell use 'ls -la' to see them. FYI, in many OS's (including windows, *nix) when files start with a dot '.gitattributes' that makes them 'hidden' files.

But it is likely you don't even have a .gitattributes file. But you can create one. I am guessing you already saw this thread: https://forum.yoyogames.com/index.p...-thrown-by-the-target-of-an-invocation.78274/

If .gitattributes can help you then I imagine possibly you added a file type in the repo that git is confused about and it doesn't, or can't, treat it as text/diff/bin... I would be curious to what the answer is.
I am sorry for no reply for a long time, I just was far away from my home, internet and PC. Now, when I am here I try doing what you ahve suggested and I can't even create the .gitattributes file, the system(win10) just sends an error saying: you have to enter file's name. By the way I have already enabled viewing hidden files, so I also have a floder inside my project called .git, but it doesn't contain .gitattributes anywhere and I still can't create it there.
UPD: I forgot to mention this problem disappears sometime, like this time I am just using GMS and everything is ok, but I have had the same situation before and the next time I thought everything would be ok but it wouldn't have been
 
Last edited:

Roldy

Member
I am sorry for no reply for a long time, I just was far away from my home, internet and PC. Now, when I am here I try doing what you ahve suggested and I can't even create the .gitattributes file, the system(win10) just sends an error saying: you have to enter file's name. By the way I have already enabled viewing hidden files, so I also have a floder inside my project called .git, but it doesn't contain .gitattributes anywhere and I still can't create it there.
UPD: I forgot to mention this problem disappears sometime, like this time I am just using GMS and everything is ok, but I have had the same situation before and the next time I thought everything would be ok but it wouldn't have been
Not sure what else to suggest. But a couple things:

  • Make sure your anti-virus is not interfering with GMS or Git
    • If you need too then add exceptions for GMS or your project folder
  • Make sure your project is on a local drive
    • Not a network mapped drive
    • Not a drop box/ Google Drive/ One Drive folder
    • Not an external media like usb
Hope that helps.
 

Petrik33

Member
Not sure what else to suggest. But a couple things:

  • Make sure your anti-virus is not interfering with GMS or Git
    • If you need too then add exceptions for GMS or your project folder
  • Make sure your project is on a local drive
    • Not a network mapped drive
    • Not a drop box/ Google Drive/ One Drive folder
    • Not an external media like usb
Hope that helps.
I think the problem could be in my disk drives, just my old PC sometimes finds imaginable drives like disc A-Z and I have infinite memory without having it at all, but when it doesn't happen the problem in GMS also seems to not happen, but that's just a guess, anyway, my big thank you!
 
Top