So I made a project using the Windows Store XAML/Mono template, and it came up with references to the SharpDX dlls prepopulated. I made a little demo app, and that seemed to work fine. Then I made a empty project with the WindowsPhone8/Mono template. This one doesn’t have SharpDX referenced, so as soon as it tries to run in the emulator (x86) it errors out at:
graphics = new GraphicsDeviceManager(this);
because SharpDX.WP8.Interop can’t be found.
So I poked around and tried to add a reference to the monogame/v3.0/Assemblies/WindowsPhone/x86 sharpdlls, and when I do, SharpDX.WP8.dll gives the error:
“A reference to a higher version or incompatible assembly cannot be added to the project.”
I researched this a bit, and checked that the dll is unblocked, but clearly I’m not understanding something.
So then I looked in my output debug directory, and hey look SharpDX dlls, even though they’re not in the solution window. Except that the SharpDX.wp8.dll isn’t there, even though it’s in the Assemblies directory. I tried copying it over by hand, but that didn’t help matters. Now I’m stuck.
Should the templates already reference SharpDX? If so, which version? How do I add them so VS 2013 will take them? Also, I note that the file set is different for different directories. There are direct2d files in Windows8 but not in WindowsPhone. Does this mean some of the API is missing on WindowsPhone? I’m writing a 2D sprite based game this makes a different to me !
OK, more research. I got MonoGameSample that was linked off of:
and that seems to work. So I started investigating differences. Looking for references to SharpDX.WP8.dll in all files in the MonoGameSample project I it in Monogamesample\Bin\x86\Debug\AppManifest.xaml as one of the assemblies:
This line is missing from the app I generated using the Monogame Windows 8 Phone project. That project has other SharpDX files, but not the wp8 one.
So, next question is where does this generated file get it’s info? It’s not from AppManifest.xml under Properties of the project. That doesn’t reference any parts at all. I’d assume it comes from the References on the project. But the MonoGameSample project only has “.Net for Windows Phone” and “Window Phone”. It doesn’t even have the “Monogame.Framework” reference. Hrrrrrm.
Well apparently the MonoGameSample did its install via NuGet, so I think it is using a newer set of stuff than I had. I found some info in the nuget files about not having monogames ref’d from the template, but getting all the info from the package. So it looks like that’s why there isn’t a Monogames reference in the sample. It wasn’t clear to me, though, which template to use for starters before installing monogames via the package manager. I tried using a blank Windows Phone App template from Visual C#->Store Apps->Windows Phone Apps and then adding Monogames via nuget, but that didn’t work either. So for now I’m just copying the one that works and renaming everything (which is a pain, but it gets me there). I’d still like to know what the “right” way is to do this, though.