Upgrading from 3.0

I have a Monogame 3.0 Windows DX project and I’d like to upgrade to the newest version. However the documention for this looks pretty sparse and I’m very confused. Is it even possible?

Since the .csproj file is now of a completely different type (presumably something to do with SDK-style projects?) I can’t simply use my existing project and change the reference to the monogame release. I also tried creating a new 3.8 project (which compiles fine) and copying over all my cs and content files, but it throws up hundresds of errors. In particular it seems to think my namespace already contains definitions for all my classes, as if I’ve got two copies of each file (which I haven’t).

Could anyone point me in the right direction here?

Seems a lot of things (in general) aren’t quite as simple or user-friendly as they once were.
Are you building from templates or using CLI/command-line-interface templates? Namespace & already defined? Hmmm… that’s really odd.
From what I’ve seen, a lot of ppl encountered some problems getting between 3.7 to 3.8. For me, I had even more problems(ie: crashing) with Visual Studio 2019 bugs (and being unbelievably slow compared to 2017).

For example, (before I turned it off) if VS does an update in the background - suddenly nothing would work forcing me to remake the project and add all the cs files again.
A few other little things didn’t work the same way. Like the graphics setup for monogame - now parameters need to be setup later in initialize - and so graphics.apply must be used.

Not sure what’s going on with the name-space or redefinition situation. I’ve encountered bugs that I thought were my fault but upon reset of computer and reloading, I found Visual Studio 2019 seemed to be the cause of the problem as everything magically works properly again later (for a while). I didn’t have this problem with VS code (however that comes with other inconveniences for those of less experience).

Not sure if that helps. If you build only an example project from template - does it still have problems? Also I’d be careful to only copy the raw cs files to add.

Thanks for your help. I finally tracked down the source of the problem to one file called Role.Designer.cs (see below). It looks like an auto-generated file that has something to do with Windows Forms (which I’ve never used). It appears somehow associated with one of my folders (Item/MobileItem/Human/Roles) but I’ve no idea how it got there. Somehow its presence breaks the entire project and throws up dozens or errors… but only with Monogame 3.8. Deleting it fixed my problem.

I kind of want to understand how this one file did so much damage. It throws up a great many “no suitable method to override” errors on completely unrelated files.

namespace Frigate_captain.Item.MobileItem.Human.Roles
{
	partial class Role
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.Text = "Role";
		}

		#endregion
	}
}
1 Like

Aha, I’m glad you figured it out. I’ve noticed a few times where something totally unrelated seems to cause an unexpected twilight-zone chain reaction. Nice. This solution might help other ppl too. :slight_smile: