How are the assemblies installed by MonoGame different from those in the MonoGame.Binaries NuGet package?

c#, monogame, nuget

Solution

thanks for asking about the MonoGame NuGet packages.

Yes, MonoGame can be used by installing the main MonoGame installer (available for Windows) which installs all supported platforms and project templates with Visual Studio. (There is a MonoDevelop package as well but this is currently out of date)

The main installer is generally only available as a stable package which is currently released as V3.2. (There is an automatically updated installer which is updated by the automatic build engine MonoGame uses, but accessing it is not generally recommended unless you REALLY know what you are doing)

Some time ago I started an initiative to also publish the MonoGame libraries (and eventually project templates), after a while this was accepted by the MonoGame core team and is not published under the official MonoGame NuGet account. Currently this offers 2 releases, the current 3.2 Stable release that is only updated with each major release, there is also a dev release (as an alpha) which is updated on a regular basis or major change more frequently.

The NuGet packages have the same goals as the installer but doesn't require anything on the machine beforehand.

Now due to limitations with NuGet we cannot deliver all the available platforms, mainly because NuGet doesn't offer detailed platform identification, just the main platform type (Windows, Windows 8, Windows Phone, Android, MonoTouch, MonoMac, etc), so none of the variances like Ouya. It also doesn't currently support Linux. This limits which platforms we can deliver in a single package, but only a little. We did have a discussion about releasing a second package for the varients but it was felt this would just confuse things.

So the platforms supported by NuGet are:

- Windows GL (.Net 4)

- Windows 8 (WINRT) Desktop and RT

- Windows Phone 8 (8.1 is not supported yet due to some dependency issues)

- Android

- iOS

- MacOs

The base DLL's are provided in the MonoGame.Binaries package

We also now ship the Project template files for empty solutions in the new MonoGame NuGet package (which also installs the Binaries package for the DLL's), this adds any platform specific files and configuration required for each platform. It also supports all of the above platforms as well.

So to use MonoGame from NuGet, you can either use an existing project built using the MonoGame installer and then remove all the references and install either the stable MonoGame.binaries NuGet or the MonoGame.binaries alpha (this means you will be notified of new releases / fixes as they are deployed). Alternatively you can start with an empty project and just install the MonoGame NuGet which will also install the project files as well as the dll's. The choice is yours.

As for the MonoGame.Portable NuGet package, this is solely maintained by me (until such time as I wine and dine the MG team to include it). This is a special version of MonoGame which can be used in PCL (portable class libraries) to create a shared library to contain your game code to abstract it from platforms. There's a post describing it's use here: http://darkgenesis.zenithmoon.com/monogame-building-portable-solutions/.

Using the Portable pattern to build your games is just another option should you wish to manage your multi-platform project that way.

Now as to the future, the MonoGame team and it's contributors recognise there are a few documentation gaps about use of the platform, the long term goal is to improve the scope of the documentation but it's a slow process. The first arm of this was tackled by creating a new samples repository to promote good standards for building multi-platform solutions with MonoGame. This repository has several other sample in development if you choose to help out. I posted about the new samples here http://darkgenesis.zenithmoon.com/monogame-building-portable-solutions/

So as you can see there are a multitude of options and the framework is constantly growing.

To sum up, you have several options to use the awesome MonoGame framework:

- Use the MonoGame main installer and use the built in project templates

- Create a solution using the installer templates and replace the DLL's with the stable NuGet release. get automatic notifications of new stable releases

- Create a solution using the installer templates and replace the DLL's with the dev / alpha NuGet release, get automatic updates of new dev releases

- Use a blank project and use either of the above NuGet releases with the same effect but you don't have to have the Installer. Note this also works in MonoDevelop with NuGet :D

- Download and use the Source Luke

If you want to use the Portable library, then do so with a shared PCL game library, then create a platform project as normal and reference the portable library for your game code.

Feel free to note down any issues with the above and I'll answer any other pertinent questions.

Hope this helps

Problem

There are a few ways to get MonoGame's assemblies into a MonoGame project as far as I can tell: - You can reference the assemblies installed by the MonoGame Installer - You can use the MonoGame.Binaries NuGet package, which you then must reference the DLLs from the package. - ... Or you can use the MonoGame.Portable NuGet package. What is the difference between these three options? How are they related to one another? How should they be used in a project? A good example of my confusion in terms of the libraries can be found in the example of `MonoGame.Binaries` vs. the assemblies installed by the installer. `MonoGame.Binaries` doesn't seem to provide the same level of granularity that the installer does, at least as far as I can tell; for instance: - From the MonoGame installer you have assemblies divided by platform: Android, iOS, Linux, Windows, WindowsGL, etc. - From the `MonoGame.Binaries` NuGet package you have only: MonoAndroid, MonoMac, MonoTouch, net40, netcore, and wp8. To me, it looks like the Monogame.Binaries package is out of date, but if it isn't and I wanted to set up a proper `Linux`, `WindowsGL`, and/or DirectX `Windows` project using the convenience of the NuGet package, would I simply choose net40 for the first two and netcore for the DirectX platform? (NB: To a certain extent, I do understand that the purpose of `MonoGame.Portable` is meant to create a cleaner code base with more code re-use that is platform independent, but its role as compared and contrasted with the other library sources is still pretty nebulous to me.)

Original source