I’ll be blogging over the next few weeks about my involvement with the MonoGame project in the dark dark backgrounds, all around the area of PCL support within the project.
I’ve been focusing on two aspects:
Now in order to use PCL projects in development you must enable your development environment to be able to target Mono platforms. For Windows based solutions, Visual Studio already enables you to target .NET / Silverlight environments, with the Phone SDK you can also include Windows Phone and with Win8 / VS2012 you get Store app support out of the box.
For Mono platforms such as iOS and Android however you need to enable these manually (at least until Xamarin studio comes out with official support)
*Note, yes you will need to install either Mono or Xamarin Studio to enable Mono platform targeting support
Worry not young Padawan, this process is very easy!
The first easy part is to create the PCL target files, one for each Mono platform, just open up notepad and create the following files:
<?xml version="1.0" encoding="utf-8"?> <Framework DisplayName="Mono for Android" Identifier="MonoAndroid" Profile="*" MinimumVersion="1.6" MaximumVersion="*" />
<?xml version="1.0" encoding="utf-8"?> <Framework DisplayName="Mono for iOS" Identifier="MonoTouch" Profile="*" MinimumVersion="1.0" MaximumVersion="*" />
Alternatively you can download the files from here – https://github.com/DDReaper/MonoGame/tree/developcore/PCL%20Targets
Now for the really tricky part, installation, this really challenging and hard to master process needs to be attempted many times before you can become proficient at it.
You need to COPY the files into a folder!, try not to be too daunted by this task
Take the above files you have created and copy them to the following folder
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile2\SupportedFrameworks
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile2\SupportedFrameworks
Now on some machines / environments you might also need to put the files into an additional / alternative folder. The reason being the profile that is used by PCL projects on your development machine, I’m sure there is a perfectly good reason for this yet the answer eludes me, so if the above doesn’t work then you need to copy the files into the folder for profile 104 instead of 2, as follows:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks
C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks
Done
Now your development environment is setup to work with PCL support for all of Mono / MonoGame’s supported platforms.
If you select XBOX360 as an additional framework to support due to it’s very restricted nature, you will now be able to enable Mono platforms. Also it renders the scope of what you can have in a PCL project to next to nothing. Best advise, keep XBOX projects separate and use “Copy” projects to support that platform.
I’ve taken my leave of work for the next few weeks (nice Easter break from work) and plan to re-up my blogging efforts with my activities of late with MonoGame and other projects, this includes:
The splitting up of MonoGame How-to : Use MonoGame PCL to build games A book review of the excellent “Kinect for Windows SDK Programming Guide” by Abhijit Jana The AdRotator V2 roadmap & progress
All that as well as have a play around with the new Unity3D SDK’s for Windows Phone and Windows 8 plus many other personal projects, should be a fun holiday (provided I get permission from the Wife )