Effect file not loading with monogame 3.6

Just installed monogame 3.6, compiled and ran into this problem when loading an effect file: “Invalid arguments, The parameter is incorrect.”

This effect file loaded perfectly on monogame 3.5 but fails when loading on 3.6. Any pointers ?

Here’s my effect file:

sampler TextureSampler : register(s0);
float4 Start;
float4 End;
int GradientMode;

float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord: TEXCOORD0) : COLOR0
{
if(GradientMode == 1)
return (Start * (1 - texCoord.y) + End * texCoord.y);
else
return (Start * (1 - texCoord.x) + End * texCoord.x);
}

technique Technique1
{
pass Pass1
{
PixelShader = compile ps_4_0 main();
}
}

Hey, I’m pretty new to shaders myself, so take this with a grain of salt, but if I change the shader model in your code to ps_4_0_level_9_1 then it loads properly.

I tried that too but still the same error :frowning: thanks for your help!

You are correct! the compiled file was not updated in the proper directory… Thanks a lot!

If you use shader profile 4_0 or up, you need to create a GraphicsDevice with GraphicsProfile HiDef. You can get that by setting the GraphicsProfile of the GraphicsDeviceManager in your Game1 constructor.