Visual Studio 2015 RTM/Monogame 3.4

Any of you experienced problems when installing monogame 3.4 with VS2015 RTM ?

Here’s a quick list of problems I got:

  • Monogame Desktop app: Content pipeline not starting, only showing a text file
  • Monogame Desktop app: App process still in memory when closing window
  • Monogame UAP: impossible to create app project, asking to update various project files

Installation: Windows 10, VS2015 RTM.

Thanks for your help!

I have the third problem for sure. Just came here to see if anyone else was having this trouble. The project template targets 2015 RC, and even when you copy files around and modify the project file to be correct, you can’t compile the thing.

I get the message that it can’t find C:\Users\<Me>\.nugget\packages\Monogame.Framework.WindowsUAP\3.4.0.459\lib\netcore\Monogame.Framework\Monogame.Framework.xr.xml, which definitely exists within that directory.

As soon as I can actually get a basic project created that compiles, I’ll be porting my app to it, and I was excited to get it done quickly. Hopefully this will be resolved soon?

I managed to make a working project eventually. Basically, the current template expects some of the files to be in a subfolder of netcore, and can’t find the SharpDX dlls inside that folder. If you copy the binaries to that folder and add the SharpDX references manually, it works. This definitely needs to be fixed. It is completely unacceptable to have no valid project template, and the nuget package is also structured wrong.

Hey there, got it to build and run.
My setup: Windows 10, Visual Studio 2015 RTM, Monogame 3.4 installed

  1. Create a Windows UAP App (Standard VS Template, NOT Monogame Template!)
  2. Search for “Monogame.framework.WindowsUAP” in “Manage Nuget Packages for Solution” and install it
  3. Copy everything from
    “C:\Users(your user).nuget\packages\MonoGame.Framework.WindowsUAP\3.4.0.459\lib\netcore”
    to
    “C:\Users(your user).nuget\packages\MonoGame.Framework.WindowsUAP\3.4.0.459\lib\netcore\MonoGame.Framework”
    (this is to solve the Framework.xr.xml error on build)
  4. Add Reference to all SharpDX* DLLs in the folder “C:\Users(your user).nuget\packages\MonoGame.Framework.WindowsUAP\3.4.0.459\lib\netcore\MonoGame.Framework” (this is to solve “SharpDX not found” in Monogame.dll)

This will make it build and run (at least for me)

Now you can load up your game as usual:

public GamePage()
{
this.InitializeComponent();

		// Create the game.
		var launchArguments = string.Empty;
        _game = MonoGame.Framework.XamlGame<Game1>.Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
    }

Fantastic, it did work for me! I was wondering do you have symptoms #1 and #2 in my previous post ?

Thanks!

I did not try anything further but to compile and start the Basic window. Will try to port an old game of mine into UAP and Reply if i Encounter any of the Problems you mentioned.

Well it did work for me, but I can’t figure out the way to load content now. I copied everything from older project to new project, even Content folder.
Is this VS2015 bug going to be fixed? It’s very frustrating that you can’t just create new project to write new game…

ByteCaptain’s solution is great but missing 1 important thing - Content. You don’t get it with standard VS UAP template.
So after doing what ByteCaptain wrote I had to copy Content.mgcb to Content folder and add to my csproj file following line:

<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
1 Like

Alright, after fighting through the 7 hells of Networking, beating the 2 headed Hydra (heads were named threading and serialization), Meeting a new Buddy which i dont know if i like him (XAML), i now finally fed the SwapChainPanel the XamlGame it deserves, and had trouble loading the Content as well. I was unable to use the Solution Prophet provided, it gave me a build error after changing the .csproject file.

I did end up using theese steps to get Content loading, they all may not be neccessary, but it works for me:

  1. Move all assets to another folder, leaving only the Content.mgcb in the Content Folder
  2. Open Content.mgcb using the Monogame Pipeline Tool
  3. Rightclick Content on the left, add > existing Item, and add all assets you moved in step 1
  4. Rightclick and build, if it does not build everything (log to the right), build every asset one by one (or in chunks) and delete those who do not build. They stop the whole Building process.
  5. in Visual Studio Solution Explorer, use “Show all files” and add the “bin” and “obj” Folder inside the Content Folder to your Project.
  6. Set everything in the “bin” and “obj” Folders to Build Action “Content” and “Copy if newer”, as well as the Content.mcgb (do not set this one to copy)
  7. In the game class, set your Content Folder to:

Content.RootDirectory = @“Content\bin\WindowsStoreApp”;

Now load your Content as usual:

font = Content.Load<SpriteFont>(“gamefont”);

I have to admit i am not very experienced with the Monogame Content Pipeline and the Content build Action, there might be a way to spare a few steps of theese.

Hope this helps and someone could optimize it.

Hey, i followed all steps you described (My setup: Windows 10 Pro, Visual Studio 2015 RTM, Monogame 3.4), but i get a System.AccessViolationException when i try to run XamlGame.Create(…); here is the stacktrace

at SharpDX.DXGI.Factory2.CreateSwapChainForComposition(ComObject deviceRef, SwapChainDescription1&descRef, Output restrictToOutputRef, SwapChain1 swapChainOut)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.CreateSizeDependentResources()
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformInitialize()
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize()
at Microsoft.Xna.Framework.Graphics.GraphicsDevice…ctor(GraphicsAdapter adapter, GraphicsProfile graphicsProfile, PresentationParameters presentationParameters)
at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize()
at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice()
at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize()
at Microsoft.Xna.Framework.Game.DoInitialize()
at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
at MonoGame.Framework.XamlGame`1.Create(String launchParameters, CoreWindow window, SwapChainPanel swapChainPanel)
at App3.GamePage…ctor()
at App3.App3_XamlTypeInfo.XamlTypeInfoProvider.Activate_0_GamePage()
at App3.App3_XamlTypeInfo.XamlUserType.ActivateInstance()
at Windows.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter)
at App3.App.OnLaunched(LaunchActivatedEventArgs e)

i hope you could help me. Fuchder99

No never had that error

Hello,

I have a “SharpDX.SharpDXException” each time I play a sound:

sndInstance = _game.Content.Load<SoundEffect>("myWav").CreateInstance()
sndInstance.Play();

Additional information: HRESULT: [0x88960001], Module: [SharpDX.XAudio2], ApiCode: [XAUDIO2_E_INVALID_CALL/InvalidCall], Message: Unknown

I used the Pipeline to create the XNB file from my Wav.

Thanks

At a guess, I’d say maybe you’re missing one of the SharpDX libraries?

I don’t think so. I added all SharpDX dll in the WindowsUAP folder from the Monogame install files and the problem is still there.

Thanks for your reply.

BTW, a workaround is to use this: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/9057c5f7-4228-4102-8427-12ef608ff349/how-to-play-sound-in-c-metro-windows-store-application-with-xaudio-2?forum=winappswithcsharp

But this solution is not enough for me because it can’t handle the “state” of a sound.