Monogame Setup and SharpDX

Hi folks.

I’m trying to get Monogame setup on a new machine and falling into the same problems as I did first time round, I need the SharpDX stuff installed as well, but I can’t find my original posts about the issue, could be in any one of several forums.

So, which Sharp Nuget pcakages do I need?


None. What issues are you getting?

You do need the DirectX runtime

Hmm, OK. I remember having to install a bunch of Sharp Nugets with my first mono install, SharpDX21 and SharpDX311 and some others. I’m pretty sure the D.X. is already there, but I’ll double check. I’m not near the machine at the moment.

I’m pretty sure this is the kind of thing I was facing with my first install:

I’m trying to run a small game which I know works perfectly on machine one and I get:

An unhandled, blah blah. ‘System.TypeLoadException’ occurred in Unkown Model. Could not find Windows Runtime Type.

Install is on a Win 7 machine, VS 2015, game written in VB. I should have mentioned VB before. I’m sure there are other install steps required.

Mono doesn’t require anything like this and MonoGame (which is what you probably meant) includes the required dll’s with the installer. You did install MonoGame, right?

Well, I installed Monogame, there aren’t any options, so how would I have got it wrong?

I do remember getting it working on the first VB 2015 machine wasn’t as straight forward as just installing Monogame.

Can you try creating a new game from the Windows DirectX template and running it?

The problem with that is, there isn’t a VB template. I’ve always had to use ‘empty’ projects put together by others, so I don’t have a way to create a completely blank project.

You’re better of creating a template anyway and then writing a Game class in VB. There’s some stuff in the templates that’s a bit annoying to do by hand. Can you just try this? At least then we know if the MG installation is alright.

If I knew how to do this and make sure it was right I would, but it’s not something I really understand.

How would the Monogame installation be incorrect?

It took a while to get the last machine up and running and I should have taken notice of everything needed, but of course I didn’t.

There was some chap I spoke to who was going to put a request into the dev people to include VB templates as it does see to be a bit of a problem.

Sorry if I was unclear before, I thought you could just mix and match C# and VB in a single project, but apparently you can’t.

I tried recreating the template in a VB project and also ran into some issues with missing assemblies and stuff :confused: Not SharpDX related though

Maybe the templates from this post will help you out. MonoGame 3.5 Project Templates for Visual Basic

Ah yes, I remember this. Unfortunately this draws a dead end too. But it did make be remember I had managed at one point to build a template I could work from.

However, when I load that project I get a load of errors like:
Type ‘Game’ not defined
Type ‘GraphicsDeviceManger’ not defined
SpriteBatch, LoadContent, GameTime etc, etc.

So, something Monogame, XNA, DX isn’t getting referenced or isn’t installed.

Any idea what;

The primary reference “MonoGame.Framework” could not be resolved because it has an indirect dependancy on the framework assembly "System.Runtime.InteropServices.WindowsRuntime, version blah blah;


Just tried downloading the Windows 7 SDK, installed and now I can get the template to load without problems, so I tried opening another old project which I know works, and now I get a load of;

Type ‘Vector2’ is not defined.

So something Monogame or xna is definitely not getting referenced properly.

The silly thing is I can’t see any difference in the setup or references on the first pc.

Very confused. Maybe it’s time for gin!

all of your references have to be in the monogame installation. You do not need anything else really, apart from .net (which you have if you use Visual studio), I think the right DirectX will be installed by default anyways.

If your basic type Vector2 is not defined it seems like your references are wrong or confused. You didn’t manually assign some xna stuff did you?

And you just created a new defautl monogame project right? This is strange then

EDIT: Oh wait do you want to compile your own version of Monogame? Or make a project with monogame?

I have a template project that I’ve used on another machine, I’ve got that to load without errors, but of course there’s no code in it. I’m not compiling Monogame, just trying to work on already existing projects.

But, if I load a project that works on the old machine I get all these errors, so the references in the code can’t be wrong, because the project already works.

I’ve installed the latest DX runtime and the Windows SDK which I remember I had to do with machine one. But I’m a bit stuck now.

This problem machine is running DX11, does Monogame need a different version?

Quick update… I’ve checked both machines using projects written a long time ago, when I open a project on the new machine it has all the same references in code and in the Properties, there is no visual difference. So whatever is wrong must be fairly low down.

Does anyone have an ideas? This is starting to drive me a bit nuts!