1
votes

I found this interesting project https://blogs.infosupport.com/adding-noise-using-a-wpf-shader-effect/ at the end can find the download link.

The problem is when I set to compile x64, visual studio 2019 designer show this error:

InvalidOperationException: PixelShader must be set on ShaderEffect.

The project can be compiled and works, but the designer just show that error, what made impossible to work in that way. This only not happen on my project, also happens on the example project when change all to compile in x64

Same happens on MS Blend. Some idea?

1

1 Answers

1
votes

I reproduced your problem. This problem is the result of disable project code.

For projects that target ARM or X64 processors, Visual Studio cannot run project code in the designer, so the Disable project code button is disabled in the designer. (Quoting from Note in document To disable project code in the designer)

When the project’s platform is set to x86 or Any CPU, the project can be displayed in the designer normally.

Edit: A suggested workaround: Design your project form with the “Any CPU” option. This will cause your code to 32-bit on 32-bit platforms and 64-bit on 64-bit platforms. The designer will work in “Any CPU” . When you need to debug 64-bit specifically, switch your build configuration to 64-bit but you can only switch back to "x86" or "Any CPU" for design).