Where is the MonoGame Framework WindowsPhone csproj file

I am trying to port my WP7 game into WP8. After referencing the MonoGame 3.0.1 .dll, I ran into the touch position is infinity bug. Reading the forums here it was suggested that I instead reference the latest develop branch code for fixes. So following this guide, I clone the develop branch and try to reference the MonoGame.Framework.WindowsPhone.csproj file in my own project, but I couldn’t find it there. Where is it?

MonoGame now uses ProtoBuild to generate the platforms.

If you wish to run from source now, you will need to start protobuild to generate them.

The instructions are on the site and in the repo, but for simplicity, just run ProtoBuild.exe located in the root of the repo to start generation. When it’s finished then you will have your .sln / .csproj files.

1 Like

Thanks for the answer. For my main game project which is a MonoGame WP8 template, I erased the regular reference to MonoGame in program files and replaced it with the reference to MonoGame.Framework.WindowsPhone project. But now I get 2 errors in GamePage.xaml:

Error 1 The best overloaded method match for ‘MonoGame.Framework.WindowsPhone.XamlGame<WinGame.Game1>.Create(string, Microsoft.Phone.Controls.PhoneApplicationPage)’ has some invalid arguments

Error 2 Argument 2: cannot convert from ‘System.Windows.Controls.DrawingSurfaceBackgroundGrid’ to ‘Microsoft.Phone.Controls.PhoneApplicationPage’

Do I need to modify the .csproj file maybe to make the Mono WP8 template work with this project reference?

Ok, in which case I’d advice not using source, but using the latest “pre-release” MonoGame NuGet packages (be sure you are using the latest NuGet extension 2.8)

For details on how to use the NuGet packages, check here - http://darkgenesis.zenithmoon.com/monogame-nuget-packages-are-go/

Backup your project before hand and let it overwrite the App.XAML and MainPage.XAML files and that will fix it for you.

Else you can create a new solution and use the NuGet packages to see the differences in the MainPage XAML for the drawing surface.

I am now getting this error on build in Microsoft.Phone.Packaging.targets:

Error 1 The “GenerateWinPRTManifest” task failed unexpectedly.
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.CCIHarvestRegistrationInformation(ProcessWinmd processWinmd, Dictionary`2 inprocServers)
at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.UpdateWinmdRegistration()
at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.ExecuteImplementation()
at Microsoft.Silverlight.Build.Tasks.GenerateWinPRTManifest.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() C:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.0\Microsoft.Phone.Packaging.targets

This is were its occurring:

        <Output TaskParameter="WMAppManifestOutput" PropertyName="WMAppManifestOutput" />
        <!--Add to Clean-->          
        <Output ItemName="FileWrites" TaskParameter="WMAppManifestOutput" />

This seems to be occurring after I reference my library project into the main game project. The library project itself references MonoGame throught NuGet Install-Package MonoGame.Binares -Pre. So this bit of information may narrow down the cause I hope.

Make sure you use the pre-release versions 3.1.4 and not the stable 3.0.1 release.

It’s been noted there is an issue on some platforms, which I’ve not gotten to the bottom of yet.

Use the latest and let us know if the issue persists.

I am using the 3.1.3 release. There is no 3.1.4 release listed. It’ll be really unfortunate if there was no solution. I have been working on porting to WP8 for 2 days now. I am surprised that at version 3, basic show-stopping bugs such as input is set to infinity still exist. So far porting to WP8 turned out to be more difficult than porting to Android and iOS, I would’ve thought the opposite would be true.

Sorry you are right, the latest is 3.1.3. (just having a moment)

Right, re-read your issue more clearly and you are using a separate library project together with your main Windows Phone project.
In which case you also need to install the binaries NuGet in the Phone class library, else the build won’t strip out the XNA pieces.
If you’r using a PCL as your library project, then install the Portable MonoGame NuGet.

Just tested in a blank solution and it had no issues. Did note that the main package for some reason still forces the 3.1.2 binaries package, so be sure to update that to 3.1.3.

1 Like

yes I did install the MonoGame.Binares -Pre NuGet package in referenced libraries. I googled a bit and found this. It might be relevant to my issue. I tried building with all projects set to ARM or x86 but the issue still persists. Though I feel am close to solving it…

Just tested in a blank solution and it had no issues. Did note that the main package for some reason still forces the 3.1.2 binaries package, so be sure to update that to 3.1.3.

Yes that’s exactly the cause, I forced the main package to update to 3.1.3 and it builds fine now :smile:

The hell? My god, I’ve installed VS2013, I’ve installed Monogame, and the samples don’t work–black screens. I see posts saying that the samples are screwed up and I should use the Platformer2D samples; those download, but now there are no .SLN files. I see this post, says to run some inexplicable ProtoBuild.exe binary–hell if I know where that is.

Can this process be any more screwed up? Do I need yet another tool to download a tool that lets me get a library so I can install an extension that gives me the binary I need to create the solution for the template sample that should actually run on my stupid phone? Jesus.

Ok, to respond to your points individually:

  1. Yes, the existing samples and starter kits samples are not maintained, hence we created the new samples library, where we will guarantee (from the team) that all the samples will work on all platforms supported by the sample. This could not be done previously as they were wholly community maintained and most weren’t kept up to date.

  2. The change in the source of MonoGame to use Protobuild has been extensively documented and made as simple as we could make it for anyone wishing to use the source. Simply clone the project and run “ProtoBuild.exe” and it will generate all the .SLN / .csproj files for you.
    This move was to help the builders / maintainers of MG gain some sanity from changes to the projects that have previously caused issues. This is an aim to improve quality not confuse things.
    If you are just building projects or using the samples, then you should use the official 3.2 release you have installed or the NuGet packages that are available, source is NOT required unless you really need to make changes to MG or do release testing.

  3. The only additional install required for MG is OpenAL for GL platforms on Windows.
    If you want just the DLL’s then use the install package and it’s templates or the NuGet packages.

Thank you for your honest input and I hope this helps to clear things up for you.


  • If you are a consumer - use the installs provided, do not use source
  • Only use the source If you are a contributor or need to make changes to MG for yourself or to push back to MG

For those of us building on Macs, what’s the alternative to using ProtoBuild.exe ? :slight_smile:

Hmm, not sure.
@hachque any ideas for running protobuild for Macs?

Use mono:

1 Like

Protobuild works on all platforms. On Mac / Linux you need to run it from the command line with mono (see the link in the previous reply).


mono Protobuild.exe --generate <Platform>

to generate for a platform other than the current desktop platform.

1 Like