質問

So I want to learn C# and XNA but after some research is came to my attention that XNA is apparently dead, and there is an alternate library called MonoGame which uses XNA framework.

So, can I use XNA lessons/ tutorials for MonoGame or are the major differences in the way programming is done depending on what you use making XNA tutorials completely useless for MonoGame?

役に立ちましたか?

解決

Almost.

MonoGame doesn't use the XNA framework, it is a re-implementation of the XNA framework. The difference is that all of the code inside MonoGame has been re-written to behave identically to the XNA framework.

You're probably wondering why someone would want to re-implement something that already exists. Well, you're correct in saying that XNA is "dead" so to speak. You can in fact still use the XNA framework if you want but it's no longer supported by Microsoft on Windows 8 or above.

However, that's not really the primary reason MonoGame came about. The real reason is that XNA only works on Microsoft platforms (e.g. Windows, XBox, Windows Phone). MonoGame's purpose is to allow existing XNA code to be easily ported to other plaforms (e.g. iOS, Android, Mac OS X, Linux, Windows 8, Windows Phone 8, PlayStation Mobile and the OUYA console)

Yes, you can use XNA lessons / tutorials for MonoGame most of the time. MonoGame's code and behaviour is intended to work exactly like the XNA framework. I say intended, because it's not perfect but it does work very well and there are plenty of games already using MonoGame to prove it.

他のヒント

XNA can still be used on windows 8, despite the being not supported. To do so you have to install a n additional component first. You have to download Windows live Games redistributable, then XNA, and it will work on windows 8.

A 2022 updated answer, craftworkgames answered best:

Yes, you can use XNA lessons / tutorials for MonoGame most of the time. MonoGame's code and behaviour is intended to work exactly like the XNA framework. I say intended, because it's not perfect but it does work very well and there are plenty of games already using MonoGame to prove it.

The following how-to is an updated expansion/extension of willthiswork89's answer. I do not suggest using it, but it is worthy of a modern answer.


As long as the DirectX9 runtime libraries are installed, XNA programs continue to run as of Windows 11. Do not forget to reboot after the DX9 installation.

The XNA installer will fail to run on modern versions of Windows. Start running the installer and leave the window open at the first prompt (to allow the installer extract the files, but before it deletes them), and find the temporary files in %tmp% or %temp%, Type this in File Explorer then sort by date (the folder name is a GUID and the newest one) and manually execute(double click) each of the .MSI files found.

The templates are a different story(MS VS > 2013). I suggest downloading a complete XNA example .SLN project, and cleaning it up after the update process, to provide a starting point.

You may still have to update the project references(the names match, but the versions may be different).

Note: GamerServices is mostly, if not totally, defunct.


I suggest using MonoGame < 4.0 as a cross-platform drop-in replacement for XNA. Instead of using this answer, since Monogame is feature complete and cross-platform.

If you prefer the old .sln project style, or require .Net framework 4.5, then look to Monogame 3.7.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top