diff --git a/MonoGame.Framework/Graphics/Effect/Effect.cs b/MonoGame.Framework/Graphics/Effect/Effect.cs
index b17dd26dbf3..45ed26b6f9f 100644
--- a/MonoGame.Framework/Graphics/Effect/Effect.cs
+++ b/MonoGame.Framework/Graphics/Effect/Effect.cs
@@ -235,10 +235,10 @@ internal static byte[] LoadEffectResource(string name)
/// used to detect old packaged content.
///
///
- /// We should avoid supporting old versions for very long as
- /// users should be rebuilding content when packaging their game.
+ /// We should avoid supporting old versions for very long if at all
+ /// as users should be rebuilding content when packaging their game.
///
- private const int MGFXVersion = 4;
+ private const int MGFXVersion = 5;
#if !PSM
diff --git a/MonoGame.Framework/Graphics/Shader/Shader.cs b/MonoGame.Framework/Graphics/Shader/Shader.cs
index 4c0e9d415d0..1cb566f35a1 100644
--- a/MonoGame.Framework/Graphics/Shader/Shader.cs
+++ b/MonoGame.Framework/Graphics/Shader/Shader.cs
@@ -102,7 +102,7 @@ internal Shader(GraphicsDevice device, BinaryReader reader)
var isVertexShader = reader.ReadBoolean();
Stage = isVertexShader ? ShaderStage.Vertex : ShaderStage.Pixel;
- var shaderLength = (int)reader.ReadUInt16();
+ var shaderLength = reader.ReadInt32();
var shaderBytecode = reader.ReadBytes(shaderLength);
var samplerCount = (int)reader.ReadByte();
diff --git a/Tools/2MGFX/DXEffectObject.writer.cs b/Tools/2MGFX/DXEffectObject.writer.cs
index a6ebd5a86bc..dc5a199089a 100644
--- a/Tools/2MGFX/DXEffectObject.writer.cs
+++ b/Tools/2MGFX/DXEffectObject.writer.cs
@@ -7,7 +7,7 @@ internal partial class DXEffectObject
{
private const string Header = "MGFX";
- private const int Version = 4;
+ private const int Version = 5;
///
/// Writes the effect for loading later.
diff --git a/Tools/2MGFX/DXShaderData.writer.cs b/Tools/2MGFX/DXShaderData.writer.cs
index 516669b97f4..4424b3c20b7 100644
--- a/Tools/2MGFX/DXShaderData.writer.cs
+++ b/Tools/2MGFX/DXShaderData.writer.cs
@@ -7,9 +7,9 @@ internal partial class DXShaderData
{
public void Write(BinaryWriter writer, Options options)
{
- writer.Write(IsVertexShader);
-
- writer.Write((ushort)ShaderCode.Length);
+ writer.Write(IsVertexShader);
+
+ writer.Write(ShaderCode.Length);
writer.Write(ShaderCode);
writer.Write((byte)_samplers.Length);