SharpDX Exception In VS 2015

I am usually working on VS Community 2013 but because of strong issues on running my game on some Windows 10 systems i need to try to use VS Community 2015.

So i installed it but it generates this error while loading a Texture2D :

HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Incorrect Parameter

I tried to search for solution but things i tried idn’t worked so i guess i am looking at the wrong places.

Thanks if you can help me.

you aren’t using the texture probably.

If the parameter does not contribute to the final output of a shader it will be deleted by the compiler, so check whether this texture is used

I have changed nothing in my project and it was working perfectly fine on VS 2013.
Why it could have changed ?

Additional info : i am on Windows 7 Pro 64 bits

does it still work fine on VS 2013?

Have you reinstalled Monogame maybe and use a different version?

You can post the shader code, we can take a look at it, but I’m almost 100% certain this is not due to VS2015

That said I recently had the same problem when using the newest version of Monogame

I had to add this line at the end with the HiDef

 public MyGame()
        {
            _graphics = new GraphicsDeviceManager(this);

            GameWindoww = Window;
            Content.RootDirectory = "Content";

           _graphics.GraphicsProfile = GraphicsProfile.HiDef;
}

Damn it’s not working in VS 2013 too. I am in a big trouble then…

I have reinstalled Monogame yes but only onto VS 2015.
Why is it also messing with VS 2013 ?

Yesterday i am 100% sure the code was working on VS 2013.
To day i installed VS 2015 and Monogame on it : all is broken.

I try your code now

There is an issue here no ?

that code is not relevant, my variable just had a wierd name, I noticed that too.

The only relevant thing is the HiDef

Sadly this code don’t change anything

And i have no shader code. I mean, i have a Sprite class loading sprites but nothing more.

It’s a 2d game also if it’s important.

As additional information, i have exactly the same version of Monogame on VS 2013 & 2015
V. 3.5.1.1679
v4.0.30319

Ok apparently the error comes from the update of the nuget Monogame.Framework.WindowsDX and going back to an older version doesn’t correct the problem. I have to take a clean save to make the game working again.

Was this trying to create a render target with a 16-bit surface format? See this post for further information.