XNA to MonoGame HLSL problem

Converted an XNA project to Monogame and I realized that my samplers dont work.

const float HuesPerTexture = 2048;
sampler DrawSampler : register(s0);
sampler HueSampler0 : register(s1);
sampler HueSampler1 : register(s2);
...
hueColor = tex2D(HueSampler0, float2(inHueIndex, IN.Hue.x / HuesPerTexture));

that’s basically what shader did before, pick a color from an index and use it. Well, basically everything went black, I manually entered some UVs to debug it, the textures seem to be loaded and some random color from the texture is shown but apparently hlsl 4.0 doesn’t have the same uv calculations with hlsl 2.0.

Just two questions:
How are you setting your samplers?
How did you calculate UV coordinates earlier (before manual entering)?

Mentioned several times, you can´t assign samplers directly anymore in monogame and you have to send texture as parameter. Thus your samplers will look like:

sampler DiffuseSampler : register(s1)
{
    Texture = (Diffuse);   
    magfilter = LINEAR;
    minfilter = LINEAR;
    mipfilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};

Where Diffuse is name of your parameter. Any sampler beyond s0 has to be treated like this. One more thing, and it is incredibly stupid (and overall I don´t like what monocontent pipeline does with shaders). Is that you need to use samplers in same order as declared. Thus let´s say I two samplers, Sampler1, Sampler2. Now in pixel shader you will have to use them in order as for example:

 float diffuse = tex2D(Sampler1, input.TextureCoordinate);
 float mask = tex2D(Sampler2, input.TextureCoordinate);

If you do following it wont work properly:

float mask = tex2D(Sampler2, input.TextureCoordinate);
float diffuse = tex2D(Sampler1, input.TextureCoordinate);

Which might be annoying as hell in some cases.

How can I upload the textures with this new shader code?

As I said in previous comment, use

sampler DiffuseSampler : register(s1)
{
    Texture = (Diffuse);   
    magfilter = LINEAR;
    minfilter = LINEAR;
    mipfilter = LINEAR;
    AddressU = wrap;
    AddressV = wrap;
};

And then name of your parameter for texture will be “Diffuse”