OpenTK ArgumentOutOfRangeException

Hi there,
a friend of mine started to work on my project and cloned the repository via SmartGit.
So far so good.

But, when he starts the project he gets following error:
System.ArgumentOutOfRangeException was unhandled Message: An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in OpenTK.dll

We figured out, if we comment out the following line
mouseState = Mouse.GetState();

The programm executes fine.
We tried VS 2015 and 2017 and also MonoGame 3.6 and 3.5.

Any ideas?

OpenTK is no longer used in 3.6?
Edit: I forgot about Mac :stuck_out_tongue: Can you share the full stack trace?

1 Like

So you compiled current version of Monogame from sources?
I guess you are running on Mac.
what you can do first is post an issue on github, with the exception details and stacktrace.

You should be using monogame 3.6 stable release binaries and see if it works

Wirago you should consider yourself lucky that Jjagg and I are competing in the contest of most helpful guy on the forum :smile:

1 Like

I got you beat :smiley: I’ve been on here longer!

2 Likes

Things are changing, I can feel you are getting a little worried :sunglasses:

2 Likes

No Mac usage here guys :-/ both using Win10
He simply downloaded the MonoGame 3.6 installer

The project was started using 3.5, so maybe there is some reference left somewhere?

in the meantime I’ve unsinstalled 3.5 on my machine and installed 3.6. but I still dont run into his issue.

Make sure you’re using 3.6, a lot of things have changed. To migrate, it’s easiest to create a new project from a template and move over your Game files. You should have SDL as the back end then, rather than OpenTK.

Also make sure you don’t use Mouse.GetState() before the Game constructor has been called (SDL won’t be initialized yet), so not in a field initializer or in your Game1 constructor.

Yeah, that did it for us.
Something was probably corrupted, but now it works. Thx guys :slight_smile:

1 Like