MonoGame and Visual Basic

Hi folks.

I found a MonoGame template that someone had kindly posted on this site, but I can’t get it to work at all with VB2012 or 2015.

Has anyone got a template for later VB versions, or is there another way to get started with VB?

I’ve been working with XNA but there seem to be problems with the xna template as fonts and sounds cannot be loaded.

No, I’m not going to learn C#!!

How easy would it be to re-write the template?

Could you elaborate on “can’t get it to work at all”?

The number of people using Visual Basic with MonoGame is very small. None of the core developers use VB (I touched it once in 1997), so support for VB is in the hands of the community who can and want to use the language.

Mono is installed ok, but there is only a C# template. So when I start a new VB project there is no template to select.

I’d be happy to re-write the template if I knew what I was doing! There must be a way to start from scratch but again, I wouldn’t know where to start.

@MuntyScruntFundle, someone asked the same question a few weeks ago. vb.net 2015 monogaqme

Hope it helps you, too.

Thanks Vogles.

It loads, it loads!! However, there are 149 Errors which are going to be reference problems.

The MonoGame framework is referenced, what else should be there?

NP. Glad it partially works for you. which version did you grab? There are two versions, Win10 UAP and Win Desktop.

FYI, the Win desktop version runs on OpenGL, because the MonoGame with DirectX binary refused to accept any version of SharpDX that I threw at it. If you need DirectX, I can try figuring this issue out. Alternatively, if you figure out what the problem was, I’d be curious how you solve it.

Ah, there’s only one zip in that link. StarterProject.VB.Win10.zip

I would love to have DX, I fear I don’t have the in depth-knowledge to work out problems with Sharp!

However, for the moment I’m working with graphically simple ideas.

Reference required to assembly 'System.Runtime, Version=4.0.20.0
Are the errors in this version.

Oh, the Windows 10 UAP version. I posted two links on that page. So, quick question: do you have Win10 & the Win 10 SDK installed?

The only MG references that project has are MonoGame.Framework (i think i grabbed MG 3.5 for this one, but 3.4 should work just fine.), SharpDX, SharpDX.Direct2D1, and SharpDX.Direct3D11. All the other references were whatever a basic VB template for Win10 UAP came with.

Slightly embarrassedly I’m now installing the W10 SDK!

Unfortunately with the SDK installed and restarted I still have the errors. Have I installed the right thing? Windows 10 SDK Standalone?

I’m not 100% sure about the Standalone SDK. I just installed it with VS2015. https://msdn.microsoft.com/library/windows/apps/dn609832.aspx

I’m having a real blonde day! Yes of course the SDK is part of the VS install, and yes it’s all installed and up to date. Not sure what the standalone has added, if anything.

I don’t understand where the System.Runtime problem is coming in.

@MuntyScruntFundle, I think i messed up the project when I cleaned it up. I was getting the same error. I remade the project and uploaded it to the same location. Try grabbing it again and testing it. Otherwise, I can just walk you through what I did to get it up and running.

Getting there, now there are only 136 errors! Reference required to mscorlib and Missing Core Assembly. And a few warnings about System.Reflection, Monogame, MicrosoftXNA, Framework doesn’t contain any public member or cannot be found.

Well, Monogame is installed, so is XNA.

I’m afraid fault finding this is a bit beyond me. I really do appreciate your help though.

OK, then do this:

  1. File->New->Project->VB->Windows->Universal->Blank App
  2. Add nuget packages: MonoGame.WindowsUAP, SharpDX, SharpDX.Direct3D11, and SharpDX.Direct2D1
  3. Then drop in the Game1 and MainPage classes from my template
  4. Profit!

If any of these steps fail, particularly step 1, 2, or 5, then there’s more going on than just a faulty template. Unfortunately, detailed VB debugging is not my forte. I haven’t written VB in 15 years.

I’ll have a go at this later today and post back for you. :o)

Hi Vogles. Well, after a fair bit of jiggering and pokering I think I’m almost there. I’ve checked all the nugets, they’ve all ended up in my references for some reason. I’ve created new classes and copied over your Game1 and MainPage code.

I have one error now:
‘C:\blahblah…\MonoGame.Framework.WindowsUAP\3.4.0.459\lib\netcore\Monogame.Framework\MonoGame.Framework.xr.xml’ does not exist.

Any ideas?

Yeah, that’s a really silly issue I’ve run into in the past, but only when manually adding the references. I’ve never received that error using Nugets.

So, the solution is to go into that folder that it’s talking about. Under netcore, you’ll find the file the compiler is complaining about. just move/copy it to a folder named Monogame.Framework under the netcore directory. That should fix it.