MonoGame and Visual Basic

I downloaded that template a while ago, it’s what I’ve used to get started, but it doesn’t have any references or imports for Mono, it’s XNA only. Or is that how it should be?

I have got confused beyond belief!

I’m thinking of just making a template, since you seem to have so much trouble with the projects I upload.

Also I’m working on a short tutorial series for my website that will get people started. I’ll make sure to target it to both c# and vb users

Hey @MuntyScruntFundle,

I just created a VS2015 template for a Windows 10 UAP project. You can find it at the link below. I also submitted a PR. Hopefully it can be part of the next release of MonoGame so others can take advantage of the template w/o scouring the forums for my link.

https://onedrive.live.com/redir?resid=61EAAB8E9F5BA8D9!34958&authkey=!AJAtfiVpxzU2-tY&ithint=file%2Czip

Well, I’ve downloaded your template, and when I try to load it I get 143 errors. :o(

I must be missing an installation of something. I have the latest DX, I have the Latest Mono. Could someone send me an installation check list? !

Is this a Framework Target problem?

Type universe cannot resolve assembly: System.Runtime, Version blah blah…

A google of this error suggests the framework target may be incorrect, however if I look in the Properties/Application tab there are no options to target a framework version, Only a Windows 10 Build version. Changing from 10586 to 10240 makes no difference.

There must be a fundamental difference in the way we have our VB’s setup. Or I’m missing something so obvious I’ll eat my toes when I find it!

The template installer I made has worked between multiple computers pretty well, tested on Visual Studio 2010 and 2015, I dont recall having missing references, but what MonoGame projects usually come with is:

DirectX:
System
MonoGame
System.Xml

OpenGL:
System
MonoGame
OpenTK
LibSDL
System.Xml

You can manually reference them yourself, to check for the references, look in the Extensions tab from the Normal Framework stuff(Top tab, then its second subtab).

However, I am well aware of the runtime error you may get, it happens because visual studio likes to change which version of MonoGame that is references to Windows Phone version… So I recomend probably selecting it manually from the folder if this is the case. I usually just delete the other monogame versions im not using when building something with monogame so it cant change the version to a pointless one like the windows phone.

If you would like, (Should you still be having troubles) You can message me on my email and we could do something for screen sharing or use team viewer and i can assist in getting your project to work :slight_smile: I have helped a few people before getting started with MonoGame and VB using the Template installer i made.

Edit: Almost forgot my email…

ArchaicOokami@gmail.com

All I have installed is windows 10 (required for win 10 uap), visual Studio 2015 with win 10 sdk, xamarin studio (for ios and
Android), then the monogame sdk

Thanks Vogles for the PR, I’m sure it would help others, not just troublesome me ;o)

Just in case you havent actually seen my templates:

If you dont trust the installer you can create the Visual Basic Templates folder yourself in “(My Documents)\Visual Studio (X)\Templates\Project Templates\Visual Basic”

and place these inside.

extract the zip files LEAVE those as zip files.

Hopefully I’ll get a chance to try this tomorrow, I’ll post back when I’ve given it a go. I think I can trust the installer! ;o)

Hi there.

I ran your installer and selected 2015. Where should I see the project type in the New Project window?

I have in there a MonoGame GameName1 template, but I think that is what I manually put there the other day from another download as the Game1 doesn’t include any imports for MonoGame, only XNA. This is what I used to get started a few weeks ago, not realising it wasn’t Mono!

I did have a lap top I could have tested on, but due to a burglary a few days ago I don’t have that any more.

you only had to have 3.4 installed or 3.5 i guess… all it does is makes it when you start up VS with VB.net you get an extra listing under the visual basic tag on the categories stuff, it says MonoGame and you make a Windows, WindowsGL, Linux etc for project. It has all the exact same imports that the C# edition does. If you dont have the MonoGame installed for the normal C# the templates will be trying to reference files that dont exist (I did not package the mono game files with it because its just code templates which arent limited to one specific monogame version)

I definitely have Monogame 3.4 installed. But I don’t see any Monogame in the New Projects list under VB. Where does your installer put the files? I have read there can be problems with Win10 and default file locations with VB.

However, using the template source files I am able to open then project without any errors. I’ll open each one and Export then as templates, this creates a New Project listing if you ask it to. Thanks for this, really, really appreciated.

Just one question, although there is a Monogame Reference, there are no imports for MonoGame in the Project, only XNA imports. Is this right?

There are a few things that make me wonder if I’m actually referencing Monogame in the correct way. For example sounds are a real issue. According to the help files I can find online a .wav file in the content folder should have a Content Importer property, but they don’t.

Sorry for the late reply… I am using windows 10 myself. The file locations shouldnt be a problem. When visual studio loads, and you go to grab Project templates, it looks in your documents(or in some cases the OneDrive), whatever your pc deems the active “Documents” folder. Then looks for Visual Studio, the templates folder etc.

I had my vb template installer look for the same thing(in the same way, where it found OneDrive/Documents intstead when the thing is used) and places the templates in there. If you get the C# templates, and have ran the template installer for vb, it will be in the same location.

From there, you dont directly see on the giant list of all templates the VB mono stuff, youll see on the drop down list a new menu item called MonoGame and clicking that will show you the proper templates.

PS: my thing is designed to detect the location similar to how vs detects the places as well so they always target same place.

“Just one question, although there is a Monogame Reference, there are no imports for MonoGame in the Project, only XNA imports. Is this right?”

MonoGame uses Microsoft.Xna.Framework namespace. It doesnt have alot under “MonoGame” namespace or imports as you are familiar with. So yes, it should say all xna imports. This was because MonoGame was a compatibility project, designed after XNA.

So, where does MonoGame actually fit into the sequence if I’m still using all xna references?

The references are to the MonoGame specific assemblies, it’s just the import statements that match Xna to ensure the same code will compile regardless of which assemblies are being referenced. Very useful in cross platform projects!