[MonoGame 3.3] HELP Fail to load Shader file

Hi,
I have this simple shader

// Effect dynamically changes color saturation.
sampler TextureSampler : register(s0);
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0

    // Look up the texture color.
    float4 tex = tex2D(TextureSampler, texCoord);
    
    // Convert it to greyscale. The constants 0.3, 0.59, and 0.11 are because
    // the human eye is more sensitive to green light, and less to blue.
    float greyscale = dot(tex.rgb, float3(0.3, 0.59, 0.11));
    
    // The input color alpha controls saturation level.
    tex.rgb = lerp(greyscale, tex.rgb, color.a * 4);
    
    return tex;
}

technique Desaturate
{
    pass Pass1
    {
        PixelShader = compile ps_4_0_level_9_1 main();
    }
}

I compile it with
2MGFX.exe desaturate.fx desaturate.xnb /Profile_DirectX_11
no error

I copy the file desaturate.xnb to content and load with
greyshader = Content.Load(“desaturate”);

I give this error "‘Microsoft.Xna.Framework.Content.ContentLoadException’ in MonoGame.Framework.dll
Could not load desaturate asset as a non-content file!

in XNA all work well :frowning:
please help me!
Predator

I have solved by myself with this function that return effect variable:

public Effect LoadEffect(string fxPath)
{
	BinaryReader Reader = new BinaryReader(File.Open("Content\\" + fxPath, FileMode.Open));
	return new Effect(GraphicsDevice, Reader.ReadBytes(Convert.ToInt32(Reader.BaseStream.Length)));
}

You should use the pipeline tool (or MGCB) to process the .fx file, don’t use 2MGFX directly.
The Pipeline tool/MGCB will output an .xnb file which is compatible with the Content pipeline. 2MGFX outputs the raw shader code.

If you use the pipeline tooling you can just do

greyshader = Content.Load(“desaturate”);

Thank you dellis,
if I use the mgcb tool it return an error as I wrote in the first post. It might be the syntax shader, I will make some checks.